Requery listbox only if form is open

Groundrush

Registered User.
Local time
Today, 20:52
Joined
Apr 14, 2002
Messages
1,376
I have a form that can be opened via two other forms & one one of them has a lst box that needs requering when the form is closed.

Code:
Forms!frmSubConControl!lstSubConOrders.Requery


The problem I have is that if I'm using the other form the above code brings up an error because the frmSubConControl is not active when using that particular form.

Is there a way to code it so it only requeries my list box when the form in question is active?



Thanks
 
Just tried this & it seems to work

Code:
If CurrentProject.AllForms("frmSubConControl").IsLoaded Then
        Forms!frmSubConControl!lstSubConOrders.Requery

    End If
 
thanks for answering your own Q

I just searched for and found your post (a month later) and it answered my Q perfectly in seconds. Thanks for being a good neighbor.
 

Users who are viewing this thread

Back
Top Bottom