MS_Access_Amature
Registered User.
- Local time
- Today, 01:34
- Joined
- Nov 10, 2010
- Messages
- 56
Im creating a punch in punch out system.
I have 3 tables: UsersT(Where the name of all the employees are), EmployeesT(Where the data from that day is stored, punch in and out time), TimeSheetT(Where all the data is and only the administrator can go inn and change).
In the form i have a listbox that brings up the employees names from the usersT. A ButtonPunchIn and a ButtonPunchOut.
My code for when I click ButtonClockIn is giving me a type mismatch error. Can someone please take a look and see if they can see the problem. They debugger stop me at : strMyValue = Me.listEmployee
Private Sub ButtonPunchIn_Click()
Dim db As DAO.Database, strMyValue As Long, datMyValue2 As Date, datMyValue3 As Date
strMyValue = Me.listEmployee
datMyValue2 = Date
datMyValue3 = Now()
Set db = CurrentDb
db.Execute "Insert into Employee (EmployeeName, DateOfWork, TimeIn) VALUES ('" & strMyValue & "',#" & datMyValue2 & "#,#" & datMyValue3 & "# )"
Set db = Nothing
End Sub
I have 3 tables: UsersT(Where the name of all the employees are), EmployeesT(Where the data from that day is stored, punch in and out time), TimeSheetT(Where all the data is and only the administrator can go inn and change).
In the form i have a listbox that brings up the employees names from the usersT. A ButtonPunchIn and a ButtonPunchOut.
My code for when I click ButtonClockIn is giving me a type mismatch error. Can someone please take a look and see if they can see the problem. They debugger stop me at : strMyValue = Me.listEmployee
Private Sub ButtonPunchIn_Click()
Dim db As DAO.Database, strMyValue As Long, datMyValue2 As Date, datMyValue3 As Date
strMyValue = Me.listEmployee
datMyValue2 = Date
datMyValue3 = Now()
Set db = CurrentDb
db.Execute "Insert into Employee (EmployeeName, DateOfWork, TimeIn) VALUES ('" & strMyValue & "',#" & datMyValue2 & "#,#" & datMyValue3 & "# )"
Set db = Nothing
End Sub