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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Requery of Form

Status
Not open for further replies.

Acipenser

Technical User
Oct 15, 2001
39
US
I am having problems requerying a form (frmData). The form gets its data from a query. On the form is a button to change information. The button brings up another form (frmChange) to select the new data from. When the frmChange closes, I want the new data to appear in frmData. I have tried many things with no success. I know I need to requery frmData, but dont know where to put the Me.Requery code.

If I hit Shift+F9 the form requeries correctly.
If I put a new button with only the code Me.Requery, it works fine.

What can I do, to get the form (frmData) to requery on its own?

Thanks
 
Hi!

If both forms are opened at the same time copy into On Unload procedure of form frmChange following string (blue):

Private sub Form_UnLoad()
forms("frmData").requery
end sub

Aivars
 
One suggestion, I would use something in there to check if the frmData isopen first.

Example I have a function called ISOpen so I would use
If Isopen("frmData") then
Place code here
End IF

If not you will generate an error.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top