Requery a combo box

  • Thread starter Thread starter Sammie
  • Start date Start date
S

Sammie

While using formB to add items to a list, I need to requery a combo box
on a subform on formA, but I am having trouble referencing it from
formB. FormA is open. I want to requery the combo box without closing
formA.

I have tried
Forms![FormA]![SubformOnFormA]![MyCombo].Requery
and
Forms![SubformOnFormA]![MyCombo].Requery

The error message tells me that it can't find the first form after
forms! in either case.

What's wrong with my code?
Thanks.
Sammie
 
[SubformOnFormA] is the subform control; the actual form (subform) is a
property of that control. And since it's not open in its own right, just as
a subform, it's not a member of the Forms collection.
Try this syntax:
Forms![FormA]![SubformOnFormA].Form![MyCombo].Requery

HTH

Sammie said:
While using formB to add items to a list, I need to requery a combo box
on a subform on formA, but I am having trouble referencing it from
formB. FormA is open. I want to requery the combo box without closing
formA.

I have tried
Forms![FormA]![SubformOnFormA]![MyCombo].Requery
and
Forms![SubformOnFormA]![MyCombo].Requery

The error message tells me that it can't find the first form after
forms! in either case.

What's wrong with my code?
Thanks.
Sammie
=----
 
Back
Top