Re: Syntax problem
Hi all,
I have a query updates the table in code it will only works if I have one criteria.
str = "UPDATE EquipMaintenance Set NextSchedMaint = #" & next_dt & "# Where [MaintTasksID] = " & rst![MaintTasksID] & ""
or
str = "UPDATE EquipMaintenance Set NextSchedMaint = #" & next_dt & "# Where [EquipmentID] = " & rst![EquipmentID] & " " "
this is error message if I have two criteria
data type mismatch in criteria expression
this code I'm trying to get it work
str = "UPDATE EquipMaintenance Set NextSchedMaint = #" & next_dt & "# Where [EquipmentID] = " & rst![EquipmentID] & " and [MaintTasksID] = " & rst![MaintTasksID] & ""
Debug.Print str
DoCmd.RunSQL str
data type for the following variables
next_dt - date
EquipmentID - text
MaintTasksID - number
I'm using AC2K
Thanks very much!
Hi all,
I have a query updates the table in code it will only works if I have one criteria.
str = "UPDATE EquipMaintenance Set NextSchedMaint = #" & next_dt & "# Where [MaintTasksID] = " & rst![MaintTasksID] & ""
or
str = "UPDATE EquipMaintenance Set NextSchedMaint = #" & next_dt & "# Where [EquipmentID] = " & rst![EquipmentID] & " " "
this is error message if I have two criteria
data type mismatch in criteria expression
this code I'm trying to get it work
str = "UPDATE EquipMaintenance Set NextSchedMaint = #" & next_dt & "# Where [EquipmentID] = " & rst![EquipmentID] & " and [MaintTasksID] = " & rst![MaintTasksID] & ""
Debug.Print str
DoCmd.RunSQL str
data type for the following variables
next_dt - date
EquipmentID - text
MaintTasksID - number
I'm using AC2K
Thanks very much!