How to display startup form only if db is not a design master?

G

Guest

Access 2000 Northwinds sample has a visual basic module that displays the
startup form only if it is not a design master. Since I am not a visual
basic programmer, I need to know how to modify the module so that I can use
it in another application that I am creating.
 
B

Brendan Reynolds

If your form is not named 'Startup' you will need to changes references to
the form named 'Startup' in the code to your own form name. For example ...

If (CurrentDb().Properties("StartupForm") = "Startup" Or _
CurrentDb().Properties("StartupForm") = "Form.Startup") Then

.... would change to ....

If (CurrentDb().Properties("StartupForm") = "YourFormNameHere" Or _
CurrentDb().Properties("StartupForm") = "Form.YourFormNameHere")
Then

Note: Change references to "Startup" or "Form.Startup" but do *not* change
references to "StartupForm" - that's the name of a property and remains the
same.

There are also references in the code to 'HideStartupForm', which is the
name of the check-box on the startup form labelled 'Don't show this screen
again'. If you have an equivalent check box on your startup form, you will
need to change this to the name of your check box. For example ...

Forms!Startup!HideStartupForm = False

.... would change to ...

Forms!YourFormNameHere!YourCheckBoxNameHere = False

If you don't have an equivalent check box on your startup form, you'll need
to remove or comment out the lines that refer to the check box. Commenting
out is the safer option - you can always remove the commented-out lines
later, after testing. For example ...

Forms!Startup!HideStartupForm = False

.... would change to ...

'Forms!Startup!HideStartupForm = False
 
G

Guest

Thanks, Brendan. Really appreciate the thoroughness and time you spent in
responding to my questions.
 

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