Requery a combo on a subform

  • Thread starter Thread starter Jody
  • Start date Start date
J

Jody

Good evening,

I'm trying to refresh a combo box on a subform within a
subform, within a form.

The combo box control is called CityID which resides on a
subform called frmLocnRespndrs, which is on a subform
called frmLocnResShell, which in turn is on a form called
frmSubscriberMain.

I open a dialog form from frmlocnRespndrs to add a
record. When the dialog is closed, I'd like to requery
the combo on the sub-subform (frmLocnRespndrs).

In the Form_AfterUpdate() of the dialog, I know I am
aiming for CityID.Requery, but I don't know the syntax of
the entire path of subforms that may be included before
CityID.Requery.

1. Any suggestions on the code syntax?

2. Also, does it matter whether the subform
((frmLocnRespndrs)is currently open when the dialog
afterupdate executes? If the form were closed, would the
same line of code work properly? This is important
because I may open the dialog while the subform is open,
but also from another menu when the subform is closed.

Any suggestions are greatly appreciated.

Cheers,
Jody
 
Thanks John. Appreciate your help.
-----Original Message-----


The name of the Form is almost totally irrelevant: what's needed is
the Name property of the *Subform control* in which that subform is
displayed. The syntax would be (if you have in fact a Subform
containing a nested Subform):

Me!frmLocnRespndrs.Form!frmLocnResShell.Form! CityID.Requery

This makes me suspicious. A Subform cannot be opened or closed
independently of its mainform - it's just a control on the form, like
a textbox or a listbox, except that it happens to be a type of control
which can contain a form. Are you using the DoCmd.OpenForm method to
open a separate, standalone form, and are just calling it a "sub"
form? If so, then it's just

Forms!frmLocnResShell!CityID.Requery



.
 
that worked very well Tina - both the full path and the
on error resume next. Thanks very much.

Jody
 
Back
Top