Open Form problem

  • Thread starter Thread starter Ian
  • Start date Start date
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
 
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...
 
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
 
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
 
Back
Top