Frustrated Trying to Requery Tab Control SubForm

JamesJoey

Registered User.
Local time
Today, 03:03
Joined
Dec 6, 2010
Messages
642
Ideally I want the closing of an editing form, called from a page on a tab control to requery all 3 pages on the tab control.

I've tried hundreds of combinations but keep getting errors.
I've been trying to get this to work on-and-off for years.

I've printed out the web page that shows about 20 different syntaxes but I believe I've tried half and none worked.
So I would appreciate of no one would simply place a ,link to this page.

The tab control is on a form called frmHome. I don't even know if I even need to reference it.

How do I reference each tab page and the form on each tab page?

James:banghead:
 
Still didn't work.

On the On Close of the editing form I'm using:

Code:
[frmReminders].Form.Requery

The error is:
Run-Time error '2465':

mydatabase can't find the field '|1' referred to in your expression.
 
From a different form, you'd need the full form reference from that link you don't want us to post. The one that starts with "Forms!..."
 
I have that printed out.

This worked:

Code:
    Forms!frmHome![frmReminders].Form.Requery
 
Perhaps

Forms!frmHome.frmReminders.Form.Requery
 
At the same time I want to requery the Subform Control Name on a different page.
But when I use this:

Code:
    Forms!frmHome![frmReminders].Form.Requery
               Forms!frmHome![frmWeeklyAgenda].Form.Requery

The error tells me it can't find the field frmWeeklyAgenda.
I even tried setting the focus to it first and still got the error.
 
Is that the name of the subform control, if different than the subform itself? Can you attach the db here? The same syntax should work.
 
Like I said, you need the name of the subform control, if different than the subform itself:

Forms!frmHome![Weekly Agenda].Form.Requery
 
I changed the name to both pages to what the actually form name is
but I now get the following error:

Run-Time error '438':
Object doesn't support this property or method.
 
The line I posted worked in your sample. I have:

Forms!frmHome![frmReminders].Form.Requery
Forms!frmHome![Weekly Agenda].Form.Requery
 
I changed it to

Forms!frmHome![frmReminders].Form.Requery
Forms!frmHome![Weekly Agenda].Form.Requery

And it works fine.

My problem is I have no idea where the heck the term "Weekly Agenda" comes from.
The only place I see this term is in the Caption property of frmWeeklyAgenda.
 
See attached, it's in the properties of the subform control.
 

Attachments

  • Properties.jpg
    Properties.jpg
    78.8 KB · Views: 171
I see now!

In design view of frmHome I was selecting only the page.
I needed to select the subfom itself.

That's why you know what you're doing and I don't.

Thanks much for your time and patience.

James
 
Happy to help James! The other thing to watch out for is if you click twice in the subform area, you get the properties of the subform itself. First click gets you the control, second click gets you the form. Lots of people miss the control because they click twice.
 

Users who are viewing this thread

Back
Top Bottom