error 2450

  • Thread starter Thread starter Maark R
  • Start date Start date
M

Maark R

error 2450: Can't find Form


On my switchboard form, I have a tiny subform with a
single field named TBD that has a query as a source which
counts records that have a flag turned on.

When I click my close form command_button of my main form
to return to switchboard, I want to requery tiny_subform,
so that the "flag count" is updated.

So in my command_close of MAINFORM I have:
Forms!tiny_subform!TBD.Requery

but I get error 2450
 
Try:
Me.tiny_subform.Form!TBD.Requery

The subform is not open in its own right (i.e. it is not part of the Forms
collection).

If that still fails, it may be that you need to requery the subform rather
than TBD, i.e.:
Me.tiny_subform.Form.Requery
 
In that case, the subform name is incorrect.

Open the main form in design view.
Right-click the edge of the subform control, and choose Properties.
What is the Name of this control?
It can be different from its SourceObject (i.e. the name of the form that is
loaded into the control).
 
Mark,
The syntax you want is:
Forms("main").Controls("tiny_subform").Form.Controls
("TBD").Requery

If you use the dot notation instead of the bang notation,
Intellisense will help you out more as you build your line.
Geof.
 
Back
Top