Hi All,
I'm having problems with my database, I spent my time looking for answers in Google yet I can't find any luck.
I also tried to search this forum and can't find any related topic into it.
I am not a pro in using Access yet I am learning the curves for my project.
I have a log in form where in the same time it will put a time stamp into a certain field.
Here are my tables and field...
tblMain where in it consist of EmpID (Primary Key)(Data Type : Number), NUser, Pass, EmpName.
tblTime where in it consist of EmpID (Number), LogInNum (AutoNumber), fldLogIn, fldLogOut.
I have a form which is NMain, this is where we log in.
For my log in button I use this :
Code:
DoCmd.RunSQL "INSERT INTO tblTime (EmpID, fldLogIn) VALUES ('" & Me.cboNUser.Value & "',#" & Now() & "#)"
and for my log out I use this :
Code:
"UPDATE tblTime SET tblTime.fldLogOut = Now()" & _
"WHERE (((tblMain.EmpID)='" & Me.cboNUser.Value & "'));"
The problem in here is when a person is trying to log out the fldLogOut is updating all the time stamp of all the users.
For example :
User 1 logs in 14:00PM
User 2 logs in 15:30
After a few moments
User 2 Logs Out 16:00
User 1 Logs Out 17:00
And then it updates User 2's log out time to 17:00 the same as User 1.
When I try using Insert into statement in log out.
The problem becames like this :
1 User 1 15:00(Log In) Null(Log Out)
2 User 1 Null(Log In) 17:00(Log Out)
I tried the other guides yet it gives me error like data type mismatch and if the other way around it gives me Enter Paramter Value.