irunergoiam
Registered User.
- Local time
- Today, 09:09
- Joined
- May 30, 2009
- Messages
- 76
I'm getting a message: Run-time Error '3144' Syntax error in UPDATE statement.
I'm not sure why it won't run - I'm sure the error is taking place somewhere between the keyboard and my chair. When I run this from an On Click event, I get this error and when I go to the code, the last line DoCmd.RunSQL strSQL is highlighted in yellow.
Any ideas or gentle nudges in the right direction would be most appreciated.
Dim strSQL As String
strSQL = "UPDATE [tblOSHWALabRequests] SET [tblOSHWALabRequests].[UpdateMedHoldDispo] = '" & cmbMedHoldDispo & "', [tblOSHWALabRequests].[UpdateMedHoldDate] = #" & unbMedHoldDispoDate & "#, [tblOSHWALabRequests].[UpdateMedHoldBy] = '" & unbMedHoldDispoBy & "', [tblOSHWALabRequests].[LabReqStatus] = " ' & cmbMedHoldDispo & '""
strSQL = strSQL & "WHERE (([tblOSHWALabRequests].[ApplicantID])=[Forms]![OSHWA_MRO_Disposition]![unbAppID]) AND (([tblOSHWALabRequests].[Req])=[Forms]![OSHWA_MRO_Disposition]![unbReq]));"
DoCmd.RunSQL strSQL
I'm not sure why it won't run - I'm sure the error is taking place somewhere between the keyboard and my chair. When I run this from an On Click event, I get this error and when I go to the code, the last line DoCmd.RunSQL strSQL is highlighted in yellow.
Any ideas or gentle nudges in the right direction would be most appreciated.
Dim strSQL As String
strSQL = "UPDATE [tblOSHWALabRequests] SET [tblOSHWALabRequests].[UpdateMedHoldDispo] = '" & cmbMedHoldDispo & "', [tblOSHWALabRequests].[UpdateMedHoldDate] = #" & unbMedHoldDispoDate & "#, [tblOSHWALabRequests].[UpdateMedHoldBy] = '" & unbMedHoldDispoBy & "', [tblOSHWALabRequests].[LabReqStatus] = " ' & cmbMedHoldDispo & '""
strSQL = strSQL & "WHERE (([tblOSHWALabRequests].[ApplicantID])=[Forms]![OSHWA_MRO_Disposition]![unbAppID]) AND (([tblOSHWALabRequests].[Req])=[Forms]![OSHWA_MRO_Disposition]![unbReq]));"
DoCmd.RunSQL strSQL