Conditional Open form on startup

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have an Access database that is emptied and re-used for each new 'campaign'
I have a main form that I go to at start-up but I want to start at a
"set-up" form until the user is ready to start at the main form.

Seems simple but I don't know how.
(Basically like the startup page you often see with programs that has a
check box saying "show this form at start")

I use a lot of VBA in the database - but I am entirely self taught so I
often don't know the basics. Thanks for any help
 
OregonIzer said:
I have an Access database that is emptied and re-used for each new
'campaign' I have a main form that I go to at start-up but I want to
start at a "set-up" form until the user is ready to start at the main
form.

Seems simple but I don't know how.
(Basically like the startup page you often see with programs that has
a check box saying "show this form at start")

I use a lot of VBA in the database - but I am entirely self taught so
I often don't know the basics. Thanks for any help

Suppose that you have a form, "frmSetup" that you want to show at
startup until the user un-checks a check-box named "chkShowAtStartup" on
the form, after which you want to show "frmMain" at startup. Here's
code for "frmSetup":

'----- start of code -----
Option Compare Database
Option Explicit

Private Sub chkShowAtStartup_AfterUpdate()

If Me.chkShowAtStartup Then
CurrentDb.Properties("StartupForm") = Me.Name
Else
CurrentDb.Properties("StartupForm") = "frmMain"
End If

End Sub
'----- end of code -----

Having created this form, all you have to do is set frmSetup as the
database's Startup Form.
 
Back
Top