I'm running an UPDATE SQL statement and sometimes it works and sometimes it doesn't. I can't figure out why.
Now I've broken up the SQL statement here just because I hate reading examples that auto-wrap here because you can't just keep scrolling to the right. But on my program the SQL is on one line.
The code works so I don't think it's the code.
Fields being entered are:
1) SSN - being pulled from another form...I can assure you the information is there...because if it wasn't then the form I'm working on, would not have even displayed.
2) BULLETSTART - being pulled from a TEXTBOX on this form called ADDBULLET. This is only the first 45 chars of the TEXTBOX (assuming there are 45 chars) followed by "..."
3) BULLET - being pulled from the same TEXTBOX on this form called ADDBULLET
4) NOTES - being pulled from another TEXTBOX on this form called ADDNOTES
The code is activated by an OnClick Event of an Button called ADDcmd
So anyway, normally I would enter a complete sentence in the ADDBULLET textbox and then just haphazard notes in the ADDNOTES textbox. While testing I was just using things like Testing 1,2,3,4 in both fields. Worked like a champ. But then I tried actually putting something like what would actually be entered. I got the error:
So I went to debug and didn't see anything wrong with my code, so I went back to the form and erased what I had put and reinput Testing 1,2,3,4 and it took. So I thought it was a length problem in my TEXTBOX. So I checked and it was a Memo field so there shouldn't be a problem with 200 chars being passed from the textbox.
I'm so lost on this and really need to figure it out and keep it from erroring out.
Any help would be greatly appreciated.
~Snay
Code:
addbulletsql = "INSERT INTO BULLETtbl " _ & "(SSN,BULLETSTART,BULLET,NOTES) "_
& " VALUES ('"_
& Forms!PERSONNELfrm!SSN.Value & "', '"_
& bulletx & "', '"_
& ADDBULLET.Value & "', '"_
& ADDNOTES.Value & "')"
Now I've broken up the SQL statement here just because I hate reading examples that auto-wrap here because you can't just keep scrolling to the right. But on my program the SQL is on one line.
The code works so I don't think it's the code.
Fields being entered are:
1) SSN - being pulled from another form...I can assure you the information is there...because if it wasn't then the form I'm working on, would not have even displayed.
2) BULLETSTART - being pulled from a TEXTBOX on this form called ADDBULLET. This is only the first 45 chars of the TEXTBOX (assuming there are 45 chars) followed by "..."
3) BULLET - being pulled from the same TEXTBOX on this form called ADDBULLET
4) NOTES - being pulled from another TEXTBOX on this form called ADDNOTES
The code is activated by an OnClick Event of an Button called ADDcmd
So anyway, normally I would enter a complete sentence in the ADDBULLET textbox and then just haphazard notes in the ADDNOTES textbox. While testing I was just using things like Testing 1,2,3,4 in both fields. Worked like a champ. But then I tried actually putting something like what would actually be entered. I got the error:
Code:
Run-Time Error 3075: Syntax error(missing operator) in query expression "whatever I typed in the two textboxes"
So I went to debug and didn't see anything wrong with my code, so I went back to the form and erased what I had put and reinput Testing 1,2,3,4 and it took. So I thought it was a length problem in my TEXTBOX. So I checked and it was a Memo field so there shouldn't be a problem with 200 chars being passed from the textbox.
I'm so lost on this and really need to figure it out and keep it from erroring out.
Any help would be greatly appreciated.
~Snay