Workaholic_711
Registered User.
- Local time
- Today, 13:09
- Joined
- Apr 9, 2019
- Messages
- 15
Hello,
I have the below code but it keeps erroring out - Run time error 3464
Private Sub Command97_Click()
Dim strSQL As String
strSQL = "INSERT INTO [TblName]([Field1],[ Field2],[ Field3],[ Field4],[ Field5]," _
& "[ Field6],[ Field7],[ Field8],[Field9]," _
& "[ Field10],[ Field11],[ Field12],[ Field13],[ Field13],[ Field14]," _
& "[ Field15],[ Field16],[ Field17],[ Field18],[ Field19],[ Field20],[ Field21],[ Field22],[ Field23],[ Field24]," _
& "[ Field25],[ Field26],[ Field27],[ Field28],[ Field29],[ Field30],[ Field31],[ Field32],[ Field33],[ Field34],[ Field35],[ Field36],[ Field37]) VALUES " _
& "('" & Me!Text100 & "','" & Me!Text106 & "','" & Me!Text114 & "', '" & Me!Text48 & "','" & Me!Text50 & "','" & Me!Text52 & "','" & Me!Text119 & "','" & Me!Text110 & "','" & Me!Text75 & "','" _
& Me!Text113 & "','" & Me!Text77 & "','" & Me!Text80 & "','" & Me!Text82 & "','" & Me.Text84 & "','" & Me.Text86 & "','" & Me.Text88 & "','" & Me.Text90 & "','" & Me.Text92 & "','" & Me.Text94 & "','" & Me.Text96 & "','" _
& Me!Text125 & "','" & Me!Text127 & "',ABS('" & Me!Check161 & "'),ABS('" & Me!Check182 & "'),ABS('" & Me!Check191 & "'),ABS('" & Me!Check194 & "'),ABS('" & Me!Check164 & "'),ABS('" & Me!Check166 & "'),ABS('" & Me!Check168 & "'),ABS('" & Me!Check170 & "'),ABS('" & Me!Check172 & "'),ABS('" & Me!Check174 & "'),ABS('" & Me!Check176 & "'),ABS('" & Me!Check178 & "'),ABS('" & Me!Check180 & "'),ABS('" & Me!Check185 & "'),ABS('" & Me!Check187 & "'),ABS('" & Me!Check189 & "'),ABS('" & Me!Check200 & "'));"
If Me!Text127 = "Yes" Then
MsgBox ("Record has not been added")
Else
MsgBox ("Record has been added")
End If
DoCmd.SetWarnings False
DoCmd.RunSQL strSQL
DoCmd.SetWarnings True
End Sub
I have the below code but it keeps erroring out - Run time error 3464
Private Sub Command97_Click()
Dim strSQL As String
strSQL = "INSERT INTO [TblName]([Field1],[ Field2],[ Field3],[ Field4],[ Field5]," _
& "[ Field6],[ Field7],[ Field8],[Field9]," _
& "[ Field10],[ Field11],[ Field12],[ Field13],[ Field13],[ Field14]," _
& "[ Field15],[ Field16],[ Field17],[ Field18],[ Field19],[ Field20],[ Field21],[ Field22],[ Field23],[ Field24]," _
& "[ Field25],[ Field26],[ Field27],[ Field28],[ Field29],[ Field30],[ Field31],[ Field32],[ Field33],[ Field34],[ Field35],[ Field36],[ Field37]) VALUES " _
& "('" & Me!Text100 & "','" & Me!Text106 & "','" & Me!Text114 & "', '" & Me!Text48 & "','" & Me!Text50 & "','" & Me!Text52 & "','" & Me!Text119 & "','" & Me!Text110 & "','" & Me!Text75 & "','" _
& Me!Text113 & "','" & Me!Text77 & "','" & Me!Text80 & "','" & Me!Text82 & "','" & Me.Text84 & "','" & Me.Text86 & "','" & Me.Text88 & "','" & Me.Text90 & "','" & Me.Text92 & "','" & Me.Text94 & "','" & Me.Text96 & "','" _
& Me!Text125 & "','" & Me!Text127 & "',ABS('" & Me!Check161 & "'),ABS('" & Me!Check182 & "'),ABS('" & Me!Check191 & "'),ABS('" & Me!Check194 & "'),ABS('" & Me!Check164 & "'),ABS('" & Me!Check166 & "'),ABS('" & Me!Check168 & "'),ABS('" & Me!Check170 & "'),ABS('" & Me!Check172 & "'),ABS('" & Me!Check174 & "'),ABS('" & Me!Check176 & "'),ABS('" & Me!Check178 & "'),ABS('" & Me!Check180 & "'),ABS('" & Me!Check185 & "'),ABS('" & Me!Check187 & "'),ABS('" & Me!Check189 & "'),ABS('" & Me!Check200 & "'));"
If Me!Text127 = "Yes" Then
MsgBox ("Record has not been added")
Else
MsgBox ("Record has been added")
End If
DoCmd.SetWarnings False
DoCmd.RunSQL strSQL
DoCmd.SetWarnings True
End Sub