requery if form isint open

Trachr

Registered User.
Local time
, 22:57
Joined
Jun 1, 2014
Messages
90
Not sure if this is in the right forum but as this is VBA Ill try it here... I have a form that could be accessed from a few different locations and I would like it to be able to requery all those locations on the chance that one or more may be open at that time.

I know you can go like this from a different form:

Forms![frmpublisheradd].[addpub_publist].Requery

But if frmpublisheradd isint currently open I get an error... is there a way around this? like an if statement maybe somehow?

basically I would like something like:

Forms![frmpublisheredit].[addpub_publist].Requery
Forms![frmpublisheradd].[addpub_publist].Requery
Forms![frmpublishersomethingelse].[addpub_publist].Requery

and only 1 of them have to be open... only I wouldnt know which one would be open so I want it to be able to do all 3.

Is this possible?
 
ah I figured it out for anyone whos curious it goes as follows

If CurrentProject.AllForms("frmseriesadd").IsLoaded = True Then
Forms![frmseriesadd].[frmseriesadd_pubcombo].Requery
End If
 

Users who are viewing this thread

Back
Top Bottom