activating opened form

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
 
G

Graeme Richardson

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

DoCmd.SelectObject acForm, "Form1"

Hope this helps, Graeme
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top