Update Query (1 Viewer)

Juniour

New member
Local time
Today, 06:10
Joined
Mar 3, 2020
Messages
18
Good day,
I know this topic has probably been discussed many times but I am struggling to find the approriate information. Could someone please show mhere I am going wrong with this Update query?

Your help would be greatly appreciated.
 

Attachments

  • Capture.PNG
    Capture.PNG
    21.3 KB · Views: 10

Ranman256

Registered User.
Local time
Yesterday, 23:10
Joined
Apr 9, 2015
Messages
3,644
too many SET commands. (only 1 needed per query)
dont use sql code, use queries. they never get syntax wrong.
 

Juniour

New member
Local time
Today, 06:10
Joined
Mar 3, 2020
Messages
18
Thank you so much for your response,
I agree with you on the query statement it works better for me.
Unfortunately the code was writen before me and it works without my addition. Now I want to add fields to the table.
Could you assist with adding my 2 new fields to the existing code?
 

arnelgp

error reading drive A:
Local time
Today, 12:10
Joined
May 7, 2009
Messages
10,871
Code:
strSQL = "Update TimeLog " & _
    "SET TimeEnd = #" & Format(Me!txtTime, "hh:nn:ss") & "#, " & _
    "Type_Of_Duty = '" & Forms!frmTimeClock!Combo508 & "', " & _
    "Flight_Time = #" & Format(Forms!frmTimeClock!Flight!Flight_Time, "hh:nn:ss") & "# " & _
    "WHERE EmployeeID = " & Forms!frmLogin!cboEmployee & " " & _
    "AND TimeEnd Is Null;"
 

Juniour

New member
Local time
Today, 06:10
Joined
Mar 3, 2020
Messages
18
AWESOME!!!!!! Your Amaizing. Thanks!!
I removed the Higlighted below to make it work.
Seems like I have a lot still to learn about syntaxes.

strSQL = "Update TimeLog " & _
"SET TimeEnd = #" & Format(Me!txtTime, "hh:nn:ss") & "#, " & _
"Type_Of_Duty = '" & Forms!frmTimeClock!Combo508 & "', " & _
"Flight_Time = #" & Format(Forms!frmTimeClock!Flight!Flight_Time, "hh:nn:ss") & "# " & _
"WHERE EmployeeID = " & Forms!frmLogin!cboEmployee & " " & _
"AND TimeEnd Is Null;"
 

arnelgp

error reading drive A:
Local time
Today, 12:10
Joined
May 7, 2009
Messages
10,871
you're welcom. i agree you need to read more on how to Concatenate between strings, date, time, number.
 

Users who are viewing this thread

Top Bottom