help!

varunmathur

Registered User.
Local time
Today, 04:39
Joined
Feb 3, 2001
Messages
68
Hi
I need to provide the database with an option to open one of the two forms depending on whether the user is a new one or has visited us earlier,
Since the user is'nt a primary key, I just register the name and time the user visits the database.
Any suggestions how could go about it.
Thanx in anticipation
varun
 
You say you "register" the name and time when the user visits the database (DB). Assuming this means you enter the name and time into a table in your DB. If this is a correct assumption, you could have code similar to the following executed when you want to open one or the other of the forms:

If DCount("User","tblVisitors","User=""" & [tbxThisUserName]) > 0 ) Then
DoCmd.OpenForm "frmOldUser"
Else
DoCmd.OpenForm "frmNewUser"
End If

This code assumes the current user, whose name is in the text box tbxThisUserName, has not yet been entered into the DB. If it HAS been entered already, then the "> 0" code should read "> 1".

HTH,
Jim
 

Users who are viewing this thread

Back
Top Bottom