Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Auto user log in

Status
Not open for further replies.

shart00

Technical User
Jun 16, 2003
63
US
When the database opens the form frmlog automatically opens which then automatically fills in the username / date and time inwhich they opened the database. Currently the timer is set so that the form will then close on timer and open the splash screen and the user can continue. The problem is that it is needed that once the database closes the field [out] will fill in for that user. Is this possible? the table is: tbllog
fields: ID - Primary key and autonumber
User - Text
Date - Date/Time Short Date format
In - Date/Time Long time format
Out - Date/Time long time format

On Open of frmlog:
me.User = environ("username")
me.data = now()
me.in = time
Which is working correctly.
the problem is with the me.out

I tried to put on timer of frmlog:
docmd.minimize
docmd.openform "frmSplash"
docmd.cancelevent (tried with and without cancel event)

Which would leave the form open then on the on close so when the database closes
Me.out = time

But either with or without cancelevent, the database just goes in loops when opening frmsplash.. Any ideas???
 
I am assuming that me.out is supposed to get populated when the user is finished doing what needs to be done with the database and then closes out the databse. If that is the case, you should realize that the form that contains me.out is a pulbic opject. Therefore, you can declare an object variable and assign it the name of that form, like you do any variable. That way, before you close everthing, you can assign a value to that field like this:

Code:
'This would be done in your main form
'frmStartupName is the name of your main form.
private myForm as frmStartupName
...
'All of your functions would be here somewhere
'if you have a command button to close the form,
'one of the tasks you would have it do is set the
'[out] field of that startup form like this
private sub cmdExit_Click(...)
    myForm.out = Now()
end sub
...

Anyway, hopefully you get the idea.

Hope this helps.
 
Hi

The Log in form does not appear to serve any purpose other than to record the user entering and leaving the database

Why not leave the login form open, but set its visible property to false, then in the form unload event put code to update the time out

this will trigger when the user exits the db and the form is unloaded

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
Looking at the forms properties but do not see a visible property.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top