2
votes

I have a form that has multiple subforms on it. When someone changes a value in a combobox of one of the subforms it needs to refresh another subform. I am using this code but it doesn't work:

Forms!frmDispatchPlanningSheet!subfrmExtraDriversForPlanning.Form.Requery

I have even tried to remove the Record Source and re-add it. However, that also did not work.

When I am saying it doesn't work for the direct requery, I don't get an error; it just doesn't requery.

For the remove and re-add the Record Source, it does remove and re-add the source; however, it still doesn't refresh the query.

however, when I click in the other form and then hit refresh all in the Ribbon, it will refresh (so I know the query works).

What am I doing wrong? how do I fix this?

1
You don't need .form.requery, try just .requeryJeffrey
I tried that but I need to change the combobox twice. So if I choose DriverA, I need to choose DriverA then click on the combobox and choose DriverA again for it to refresh. It seems like it is not saving earlier enough. I put this in the AfterUpdate for the combobox; I tried to put that in the AfterUpdate event for the form and it doesn't even fire.djblois

1 Answers

1
votes

If subfrmExtraDriversForPlanning refers to Driver via the table, you need to save the record first.

Add

Me.Dirty = False

before doing the .Requery.