Log-in (form or event)

J

Jackie

Good afternoon:
Has anyone out there already developed a Log-in form for
users?

This is what I am attempting to do.

The student will enter an ID number into the ID field,
login date, and login time are all entered into the login
table. When the student leaves the lab they will have to
bring up their record and (onclick) logout time is
entered into the table.

I know to use the system date and times but I am really
stumped on the log in. The student should only be able
to see their own record......
I am hoping someone has done something like this and I
don't have to reinvent the wheel....I have worked on this
way too much and have just gone in circles! Help
Thanks
Jackie
 
G

Graham R Seach

Jackie,

Do the students do anything in the database once they've logged in, or are
you just recording the fact that they logged in/out?

If they are going to do anything, implement user/group-level security, and
they will always see the login dialog whenever they fire up the database.

Create an AutoExec macro to open a hidden form, which will remain open (but
hidden) until the database is shut down. Code in the form's Load event can
record the student's login, and similarly, the Unload event can record their
logout.

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia

Microsoft Access 2003 VBA Programmer's Reference
http://www.wiley.com/WileyCDA/WileyTitle/productCd-0764559036.html
 
J

Jackie

Graham,
Thanks for the direction. I will check out the web
address you sent me.

Actually the way I would like to design the student
overlay is the only access they will have is to first
input their ID #, (I am not sure how to do this) that
would bring up their name (for verification purpose) next
they would simple click the button for log in.
The onclick will then enter the system date and time into
the log in table. I would then do the same for the log
out form.
I am thinking of creating separate LogIn and LogOut
tables for ease of design purpose.... what do you think?
Thanks again for the advice, I am the only one in our
division that works with Access and have no one to
network with for problems like this.
 
G

Graham R Seach

Jackie,

<<I will check out the web address you sent me.>>
What web address? If you mean the wiley address, that's just part of my tag
line.

I would have two tables; one for usernames and passwords, and the other for
login/logout.

For the login form, just create a form as normal, and put code in the OK
button's Click event to check the username and password, and if successful,
log the user in or out (as appropriate). The difficulty is going to be in
getting the system to decide whether to log the user in or log them out. If
this was an application that remained open until the user shut it down, I
would create a session ID, which would be saved with the login. When it came
time to logout, the logout record would be saved against the login with the
same session ID.

There is no need for the user to enter the login datetime - the system can
do that. After all, users aren't always the most honest of creatures. :)

You still haven't said whether the user will keep the application open, or
whether they will fire it up to login; shut it down; and fire it up again to
logout.

You also seemed to indicate that you didn't know how to get the user to
enter their username and password. If that's true, then we have a lot more
work to do.

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia

Microsoft Access 2003 VBA Programmer's Reference
http://www.wiley.com/WileyCDA/WileyTitle/productCd-0764559036.html
 
J

Jackie

Graham,
Sorry for not getting back to you sooner, I have been in
meetings for two days. I am including my design notes; I
hope they make sense. I have also included my email
address, if you would like to use that address it might
be easier than wading through all the postings to find
me! :)
Thanks again for your help
Jackie

Here is what I worked out:
1) 1st Student Form 'Log in button & Log out button'
When Login Button clicked
'Prompt user for ID#' (this is where I am really lost,
have always used combo box for this, but will not work
here)'
"Enter Student Auto ID"
IF ID matches tblStudents.AutoID
'Student verification by showing student
name'
THEN Student Text Box = tblStudents.LName &
tblStudents.FName
'Build ok button if name is correct'
2) OnClick of OK button GOTO
Pop-up Form Log In button
'On click enter system time and system
date'
OnClick tblLogTime.LogDate = System Date,
tblLogTime.LogIn = System Time
'Return to 1st Student Form after date and time entered'
ELSE Error message "Not a current ID number"
'Return user to 1st Student Form'

'Log out procedure'
3) 1st Student Form
OnClick LogOut button

IF tblLogTimes.LogDate=Now()

THEN GOTO pop-up form Log Out button
OnClick tblLogTimes.LogOut=System Time
'Return student to 1st Student Form'
ELSE error message "Missing Log In"
OnClick OK button return student to 1st student
form


on your questions of direction; I think I have a good
design, but do not think I can get there without useing
VBA,(something I have avoided learning) :(
 

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