0

im having problem og this code...

txtTimeOut.Text = Format(Now, "h:mm:ss tt")

            constr = "UPDATE tblDTR SET EmpName='" & txtName.Text _
            & "', Date_in='" & Format(Now, "MMMM d, yyyy") _
            & "', Time_in='" & txtTimeIn.Text _
            & "', Date_out='" & Format(Now, "MMMM d, yyyy") _
            & "', Time_out='" & txtTimeOut.Text _
            & "'WHERE EmployeeID=" & txtEmpID.Text

im having an error of datatype mismatch in criteria expression i checked the table i made and it has the same name and right rows to insert data into.. i just can't find the problem in my code.. can someone help me?..

btw im doing a dtr system the code shown above is for the time-out of an employee..

4
Contributors
8
Replies
9
Views
6 Years
Discussion Span
Last Post by Mike Askew
0
& "'WHERE EmployeeID=" & txtEmpID.Text

try

& "'WHERE EmployeeID='" & txtEmpID.Text & "'"

if EmployeeID is a text field.

also try putting a spce between "'" and "where"

0

check your input with your data type in database.
like date, your input must be suitable with database type.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.