AccessNewbie73
New member
- Local time
- Today, 09:52
- Joined
- Dec 8, 2009
- Messages
- 5
Hello everyone,
I'm venturing into my first attempts at sql and am getting a "Run-time error '3134': Syntax error in INSERT INTO statement. Here's the code below. Any suggestions??
Private Sub cmdSaveLabRequest_Click()
Dim strCriteria As String
Dim strSQL As String
If Me.unbOrderedBy = "" Then
MsgBox (" Ordered By field cannot be blank")
Else
If Me.cmbMinistry = "Select Ministry" Then
MsgBox (" Select Ministry")
Else
DoCmd.SetWarnings False
DoCmd.RunSQL "INSERT INTO tblOSHWALabRequests (Candidate, ApplicantID, Req, StartDate, DOB, Position, PL-Dept, Ministry, DateLabsOrdered, OrderedBy, AllNewHireLabs, QuantiferonGold, RubeollaAntibody, RubellaAntibody, MumpsTiter, HepBSurfAntigen, UrineDrug, LeadLabTests, BloodLead, ZincProtoporphyrin, LeadCBCDiff, OncLabTests, OncCBCDiff, CMBP, SGPT, DCProviderLabTests, DCCBCDiff, MiscLabTests, VaricellaAntibody, UAHCG,) Values (cmbCandidate, unbApplicantID, unbReq, unbStartDate, unbDOB, unbPosition, unbPLDept, cmbMinistry, unbDateOrdered, unbOrderedBy, unbAllLabs, unbAllTests1, unbAllTests2, unbAllTests3, unbAllTests4, unbAllTests5, unbAllTests6, unbPBTests, unbPBTest1, unbPBTest2, unbPBTest3, OncTests, OncTest1, OncTest2, OncTest3, OncTest4, unbDCProvidersTests, unbDCProvidersTest1, unbMiscTests, unbMiscTest1, unbMiscTest2)"
End If
End If
Me.Refresh
DoCmd.SetWarnings True
End Sub
I'm venturing into my first attempts at sql and am getting a "Run-time error '3134': Syntax error in INSERT INTO statement. Here's the code below. Any suggestions??
Private Sub cmdSaveLabRequest_Click()
Dim strCriteria As String
Dim strSQL As String
If Me.unbOrderedBy = "" Then
MsgBox (" Ordered By field cannot be blank")
Else
If Me.cmbMinistry = "Select Ministry" Then
MsgBox (" Select Ministry")
Else
DoCmd.SetWarnings False
DoCmd.RunSQL "INSERT INTO tblOSHWALabRequests (Candidate, ApplicantID, Req, StartDate, DOB, Position, PL-Dept, Ministry, DateLabsOrdered, OrderedBy, AllNewHireLabs, QuantiferonGold, RubeollaAntibody, RubellaAntibody, MumpsTiter, HepBSurfAntigen, UrineDrug, LeadLabTests, BloodLead, ZincProtoporphyrin, LeadCBCDiff, OncLabTests, OncCBCDiff, CMBP, SGPT, DCProviderLabTests, DCCBCDiff, MiscLabTests, VaricellaAntibody, UAHCG,) Values (cmbCandidate, unbApplicantID, unbReq, unbStartDate, unbDOB, unbPosition, unbPLDept, cmbMinistry, unbDateOrdered, unbOrderedBy, unbAllLabs, unbAllTests1, unbAllTests2, unbAllTests3, unbAllTests4, unbAllTests5, unbAllTests6, unbPBTests, unbPBTest1, unbPBTest2, unbPBTest3, OncTests, OncTest1, OncTest2, OncTest3, OncTest4, unbDCProvidersTests, unbDCProvidersTest1, unbMiscTests, unbMiscTest1, unbMiscTest2)"
End If
End If
Me.Refresh
DoCmd.SetWarnings True
End Sub