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..

Recommended Answers

& "'WHERE EmployeeID=" & txtEmpID.Text

try

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

if EmployeeID is a text field.

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

Jump to Post

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

Jump to Post

All 8 Replies

please.. i need help so badly.. :(

& "'WHERE EmployeeID=" & txtEmpID.Text

try

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

if EmployeeID is a text field.

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

employee id is a number field...
how is it?

employee id is a number field...
how is it?

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

im sorry, yes its a textfield.. i just got confused.. thnks for the reply..

What is the exact syntax error? and what input are you entering into the textbox?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.