Open Form problem

I

Ian

For my form's "On Open" event I am using an "If"
statement where if a certain condition is met, I want a
second form to open. I am using "DoCmd.OpenForm ("form
name") The second form opens OK but the view stays with
the first form. I want to see the second form at this
point. It works fine when I switch from Design view to
Form view but not when I open the orignal form the first
time.

Can anybody please help me with this?!!!

Thanks
 
M

MacDermott

You might want to open the second form with the acDialog argument, which
will keep it on top and prevent anything from happening on the first form
until the second one is closed or set to .visible=false.
Or you might want to explicitly make the first one invisible, and bring
it back when the second one closes...
 
I

Ian

Thanks very much for your suggestion. Only problem is
I'm not very good at code - I only know the basics.
Could you please give me an example as to what I should
use. So far I have:

DoCmd.OpenForm "Form Name"

How do I add the acDialog bit you mentioned - I can't
figure it out.

Thanks
 
M

MacDermott

Open your code editor to the line
DoCmd.OpenForm "FormName"
Put a comma after "FormName" -
you should see a drop box with options for the next argument.
Keep adding commas until you see an option with acDialog.
At that point, click on acDialog.

Another approach is to open the Access Help file and do a search on
OpenForm.
You'll get a page of explanation of the various arguments and how to use
them.

HTH
- Turtle
 

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