activating opened form

  • Thread starter Thread starter Alex
  • Start date Start date
A

Alex

I have a button on Form1 to open Form2
(DoCmd.OpenForm ...).
But, If the Form2 is already opened and a user anyway is
clicking the button to open the Form2, the data appears
with mistakes there.

I'm checking whether the form is already opened by using
the following:
If SysCmd(acSysCmdGetObjectState, acForm, stDocName) > 0
Then ...
If it's not opened DoCmd.OpenForm ...
But, if it's already opened what command could I use to
just activate the form that the user could continue to
work on it?

Thanks
 
Hi Alex, if the form is already open then this statement will activate it:

DoCmd.SelectObject acForm, "Form1"

Hope this helps, Graeme
 
Back
Top