Syntact to Requery a tab control

R

Renee Moffett

Can someone help me get my syntax straightened out? When a button on the
main form is clicked, I have an append query running. But the user doesn't
see the changes on the subform. I need to add a requery statement to the
code on this button, but I'm having trouble figuring out how to refer to it.

Main Form Name: frmLocationMaintenance
Tab Name (on above form): tabMiniMktPlan
Subform Name (on above tab): fsbMiniMarketingPlan

Below is what I've tried and the resulting errors. Your help is
appreciated.

DoCmd.Requery Forms!frmLocationMaintenance!tabMiniMktPlan
This gives Run-time error 2498: An expression you entered is the wrong
data type for one of the arguments.
DoCmd.Requery Forms!frmLocationMaintenance!tabMiniMktPlan
This gives Run-time error 438: Object doesn't support this property or
method.
DoCmd.Requery Forms!frmLocationMaintenance!Form!fsbMiniMarketingPlan
This gives Run-time error 2465: MS Access can't find the field 'Form'
referred to in your expression.
DoCmd.Requery
Forms!frmLocationMaintenance!tabMiniMktPlan.Form!fsbMiniMarketingPlan
This gives Run-time error 438: Object doesn't support this property or
method.
 
R

Rick Brandt

Renee Moffett .Moffett .com> said:
Can someone help me get my syntax straightened out? When a button on the
main form is clicked, I have an append query running. But the user doesn't
see the changes on the subform. I need to add a requery statement to the
code on this button, but I'm having trouble figuring out how to refer to it.

Main Form Name: frmLocationMaintenance
Tab Name (on above form): tabMiniMktPlan
Subform Name (on above tab): fsbMiniMarketingPlan

Below is what I've tried and the resulting errors. Your help is
appreciated.

DoCmd.Requery Forms!frmLocationMaintenance!tabMiniMktPlan
This gives Run-time error 2498: An expression you entered is the wrong
data type for one of the arguments.
DoCmd.Requery Forms!frmLocationMaintenance!tabMiniMktPlan
This gives Run-time error 438: Object doesn't support this property or
method.
DoCmd.Requery Forms!frmLocationMaintenance!Form!fsbMiniMarketingPlan
This gives Run-time error 2465: MS Access can't find the field 'Form'
referred to in your expression.
DoCmd.Requery
Forms!frmLocationMaintenance!tabMiniMktPlan.Form!fsbMiniMarketingPlan
This gives Run-time error 438: Object doesn't support this property or
method.

The syntax you want is...

Forms!MainFormName!NameOfSubFormControl.Requery

WARNING: The name of the subform *control* is not guaranteed to be the
same as the subform it references.
 
R

Renee Moffett

Thanks for your help, Rick. That did it.


Rick Brandt said:
The syntax you want is...

Forms!MainFormName!NameOfSubFormControl.Requery

WARNING: The name of the subform *control* is not guaranteed to be the
same as the subform it references.
 

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

Similar Threads

A2K Subform Requery 2
MainForm SubForm Requery from Third Form 2
requery question 1
problems with 'cbo's and requery 2
requery problems 1
requery not working 7
REQUERY SUBFORM 4
Requery listbox runtime error 438 2

Top