bretdunlap
Registered User.
- Local time
- Yesterday, 16:31
- Joined
- Nov 15, 2011
- Messages
- 54
HI
I have a SQL error but it only happens occasionally I can't nail down when it will happens. The only consistent part, basically I have a way of sending good job notes to people, I type in the note then save it to a drop down if I never typed it before, then after sending it to ms publisher, I then hit the save button it gets date stamped with the persons code so I can see what was the last not I sent that person.
occasionally I get an error
3075 Syntax error (missing operator) in query expression "We Miss you class just isn't the same with out you',' Adults','Bouer','Jeff')'.
here is the code the problem is it works great but not with some of the drop downs as if the wording in the note is throwing off the code.
Private Sub CommandSaveGJN_Click()
Dim sSql As String
If Len(textGoodJobNote) = 0 Or IsNull(textGoodJobNote) Then
MsgBox "Please Enter a Note!!!"
Exit Sub
ElseIf Not IsNull(Me.Text50.Value) Or Len(Me.Text50.Value) = 0 Then
sSql = "INSERT INTO [GoodJobNotesQuery] (StudentID,GJNotes,Team,LastName,FirstName) VALUES ('" & Me!Text50 & "','" & Me!textGoodJobNote & "','" & Me!Text26 & "','" & Me!Text2 & "','" & Me!Text0 & "')"
CurrentDb.Execute sSql
textGoodJobNote = ""
ListGoodJob.Requery
End If
End Sub
I have a SQL error but it only happens occasionally I can't nail down when it will happens. The only consistent part, basically I have a way of sending good job notes to people, I type in the note then save it to a drop down if I never typed it before, then after sending it to ms publisher, I then hit the save button it gets date stamped with the persons code so I can see what was the last not I sent that person.
occasionally I get an error
3075 Syntax error (missing operator) in query expression "We Miss you class just isn't the same with out you',' Adults','Bouer','Jeff')'.
here is the code the problem is it works great but not with some of the drop downs as if the wording in the note is throwing off the code.
Private Sub CommandSaveGJN_Click()
Dim sSql As String
If Len(textGoodJobNote) = 0 Or IsNull(textGoodJobNote) Then
MsgBox "Please Enter a Note!!!"
Exit Sub
ElseIf Not IsNull(Me.Text50.Value) Or Len(Me.Text50.Value) = 0 Then
sSql = "INSERT INTO [GoodJobNotesQuery] (StudentID,GJNotes,Team,LastName,FirstName) VALUES ('" & Me!Text50 & "','" & Me!textGoodJobNote & "','" & Me!Text26 & "','" & Me!Text2 & "','" & Me!Text0 & "')"
CurrentDb.Execute sSql
textGoodJobNote = ""
ListGoodJob.Requery
End If
End Sub