Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Requery??

Status
Not open for further replies.

Zeroanarchy

Technical User
Jun 11, 2001
630
0
0
AU
Does anyone have a better way of writting this:
forms![Autoexec]![child31].requery

I am having problems in that I am trying to run this command from another child form inside Autoexec and it works sometimes and not others.

Any ideas apreatiated

[afro]Zeroanarchy Experience is a wonderful thing. It enables you to recognize a mistake
when you make it again.
 

Zero,

I’m trying to piece this one together from memory. I’m at client site and do not expert to get back to office before noon. Give these a try. One of them should do the trick. If not, post back and when I get home, I’ll find it in my notes.


Forms!frmname.childname.form.requery

Forms!frmname.childname.requery
Robert Berman
Data Base consultant
Vulcan Software Services
thornmastr@yahoo.com
 
Zero,

Robert's first answer is the one you want to you use. When you replace his names with yours, be sure to use the name of the control that holds your subform, not the name of the subform. The reasoning here is that you are first refering to the control and then, with the ".form" telling access that you want to refer to a method of the form held in that control.

Also, think about changing the name of your form. It's quite common to use a macro called "autoexec" to run some code at when your application opens, and if you do this you'll be creating all sorts of confusion for both you and access.

Jeremy =============
Jeremy Wallace
Designing, Developing, and Deploying Access databases since 1995.
 
THanks both of you, the problem I am having must be somewhere else in my code.

[afro]Zeroanarchy Experience is a wonderful thing. It enables you to recognize a mistake
when you make it again.
 
Zero,

I'm having the same problems with my subforms and i've found that if i add a "sleep" function after the save and b4 the requery it "requeries" more often than not. I'm not sure if this is coincident or not though, so not sure if this will help you. also one thing i noticed is that when i was developing the app on my local hard drive i never had this problem, it was only after i moved the app onto the network that this problem started occuring. again this might be coincident more than the cause of the problem.

jeff
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top