I'm having trouble using form values within the DoCmd.RunSQL SQL3 statement shown below. I'm guessing I need some specific combination of quotes in order for the form value in variable RequisitionID to be evaluated properly. It looks ok in debug mode but when the SQL3 runs it gives:
RunTime error 3075: Syntax error (missing operator) in query expression '4567AAAA'. The '4567AAAA' is the value of variable RequisitionID which is at the end of the SQL3 statement.
btw - It's Access 2000
Thanks in advance for any help you can provide...
RunTime error 3075: Syntax error (missing operator) in query expression '4567AAAA'. The '4567AAAA' is the value of variable RequisitionID which is at the end of the SQL3 statement.
btw - It's Access 2000
Thanks in advance for any help you can provide...
Code:
Set db = CurrentDb()
Set rs = db.OpenRecordset("TblHighestUsedReqDetailNumber")
Let HighestReq = rs("HighestUsedReqDetailNo") + 1
Set r2 = db.OpenRecordset("BOW_BOWORKFILE__WS_ESTIMATE")
Let JobNumber = r2("Job_number")
Let ModifiedJob = Left(JobNumber, 2) & Mid(JobNumber, 4, 4) & Mid(JobNumber, 9, 2)
Let RequisitionID = Mid(JobNumber, 4, 4) & Forms!FdlgUpdateFiles!Phase
Let SQL1 = "UPDATE TblWorkReqDetail SET TblWorkReqDetail.reqlineno =" & HighestReq
Let SQL2 = "Update TblWorkReqDetail SET TblWorkReqDetail.job =" & ModifiedJob
Let SQL3 = "Update TblWorkReqDetail SET TblWorkReqDetail.requisitionno =" & RequisitionID
DoCmd.RunSQL SQL1
DoCmd.RunSQL SQL2
DoCmd.RunSQL SQL3