error 2450

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
 
A

Allen Browne

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
 
M

Mark R

THanks Allen,

I tried both.
Both gave me Compile error: Member or data method not
found.
 
A

Allen Browne

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).
 
G

Geof Wyght

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top