A
AHopper
I want to update three
fields "Closed"(Yes/No), "DateClosed" (Date/Time),
and "EmployeeClosed" (Number) in the same
table "BatchNumber". Presently I am using three SQL
statements to do this. They work but can they be combined
into one SQL?
DoCmd.SetWarnings True
SQL = "UPDATE BatchNumbers SET BatchNumbers.Closed = -1 "
& "WHERE ((BatchNumbers.UsedWithJob)=" & Me.UsedWithJob
& "And (BatchNumbers.BatchNumber)=" &
Me.OperatorBatchNumber & ");"
DoCmd.RunSQL SQL
SQL = "UPDATE BatchNumbers SET BatchNumbers.DateClosed =
Now " & "WHERE ((BatchNumbers.UsedWithJob)=" &
Me.UsedWithJob & "And (BatchNumbers.CoilerBatchNumber)=" &
Me.OperatorBatchNumber & ");"
DoCmd.RunSQL SQL
SQL = "UPDATE BatchNumbers SET BatchNumbers.EmployeeClosed
= [Forms]![OneTwoOperatorForm]![EmployeeNo] " & "WHERE
((BatchNumbers.UsedWithJob)=" & Me.UsedWithJob & "And
(BatchNumbers.CoilerBatchNumber)=" &
Me.OperatorBatchNumber & ");"
DoCmd.RunSQL SQL
DoCmd.SetWarnings True
Still learning how to use SQL so any help would be
appreciated.
Thanks
Allan
fields "Closed"(Yes/No), "DateClosed" (Date/Time),
and "EmployeeClosed" (Number) in the same
table "BatchNumber". Presently I am using three SQL
statements to do this. They work but can they be combined
into one SQL?
DoCmd.SetWarnings True
SQL = "UPDATE BatchNumbers SET BatchNumbers.Closed = -1 "
& "WHERE ((BatchNumbers.UsedWithJob)=" & Me.UsedWithJob
& "And (BatchNumbers.BatchNumber)=" &
Me.OperatorBatchNumber & ");"
DoCmd.RunSQL SQL
SQL = "UPDATE BatchNumbers SET BatchNumbers.DateClosed =
Now " & "WHERE ((BatchNumbers.UsedWithJob)=" &
Me.UsedWithJob & "And (BatchNumbers.CoilerBatchNumber)=" &
Me.OperatorBatchNumber & ");"
DoCmd.RunSQL SQL
SQL = "UPDATE BatchNumbers SET BatchNumbers.EmployeeClosed
= [Forms]![OneTwoOperatorForm]![EmployeeNo] " & "WHERE
((BatchNumbers.UsedWithJob)=" & Me.UsedWithJob & "And
(BatchNumbers.CoilerBatchNumber)=" &
Me.OperatorBatchNumber & ");"
DoCmd.RunSQL SQL
DoCmd.SetWarnings True
Still learning how to use SQL so any help would be
appreciated.
Thanks
Allan