Gather Data Upon Startup

  • Thread starter Thread starter Kyle Petersen
  • Start date Start date
K

Kyle Petersen

I am developing a database and I need help on an idea I have. I want to pop
up a form (only on the first time of use) that would ask for specific
information that will be used to print on reports and stuff (i.e. name,
location, of user). I need to know how to make this form pop-up only on the
first load of the program, and after that it should open up my form menu I
created.

Thanks
 
Well, where do you intend to store the entered data? In a table, I presume.
Then all you have to do on every open of your app is check to see if there
is a record in that table - if there is, don't pop the form, just display
your main form. If there isn't, pop the form. Something like this in the
Open event of your main form:

Private Sub Form_Open()
Dim rs As Recordset

Set rs = CurrentDb.OpenRecordset("SELECT * FROM UserInfo")

If rs.EOF Then
'pop the one-time form here
End If

rs.Close

End Sub

P.S. I would suggest providing a command button somewhere to pop this form
in case the user's info changes for some reason.
 
Back
Top