Hello, if possible could someone tell me the if statement for opening/closing forms
in my case I want it to be that if "frmcustomers" is already open do nothing.
if "frmcustomers" is not already open then open "frmcustomers"
thank you kindly.
Hello, if possible could someone tell me the if statement for opening/closing forms
in my case I want it to be that if "frmcustomers" is already open do nothing.
if "frmcustomers" is not already open then open "frmcustomers"
thank you kindly.
Search on IsLoaded, which can be used to tell you if the form is open.
sorry, im not sure what that means.
This is for a button onclick event
I need part of it to be like
if "frmcustomers" is open then do nothing
if "frmcustomers" is not open then open "frmcustomers"
the reason is im using the form where the button is located from two different entry points, one where the "frmcustomers" will be already open and one where it will be closed.
The code would look like:
Code:If Not <IsLoaded code here> Then DoCmd.OpenForm "frmcustomers" End If
triedit tells me frmcustomers "variable not defined"Code:If Not CurrentProject.AllForms(frmcustomers).IsLoaded Then DoCmd.OpenForm "frmcustomers" Else End If
ive never used isloaded before not sure what im doing to be honest.
EDIT: quotes around frmcustomers. got it thank you Pbaldy.
The form name needs to be in quotes.