I have the following code which, when I debug.print the strSQL, I get the updated data.
The problem is, it doesn't save the changes and it doesn't thow an error, so I can't tell you what the error message could be.
Can anybody see what is wrong with the code?
Or could it be something wrong with the database set up, although there are plenty of records successfully saved into it!
Please remember to rate posts! Rate any post you find helpful. Use the link to the left - "Rate this Post". Please use [highlight='vb'] your code goes in here [/highlight] tags when posting code. When a question you asked has been resolved, please go to the top of the original post and click "Thread Tools" then select "Mark Thread Resolved."
1) how do you *know* it's not saving the changes?
2) I highly suggest you parameterize that query and use that instead. Many times a parameterized query is far easier to debug.
3) display the SQL in a message box before running it... see if anything jumps out at you.
4) Even though you thinkj you aren't getting errors, check the Errors Collection in the Connection object.... there might be something in there.
Have you tried looking at the value of strSQL before it is executed? output the value of strSQL into the immediate window and then copy and paste it into an Access Query and see if it updates. Can you post the value of strSQL?
Regards,
Mark
Please remember to rate posts! Rate any post you find helpful. Use the link to the left - "Rate this Post". Please use [highlight='vb'] your code goes in here [/highlight] tags when posting code. When a question you asked has been resolved, please go to the top of the original post and click "Thread Tools" then select "Mark Thread Resolved."
it's possible you are trying to update a non-existent record.
Good point.
Regards,
Mark
Please remember to rate posts! Rate any post you find helpful. Use the link to the left - "Rate this Post". Please use [highlight='vb'] your code goes in here [/highlight] tags when posting code. When a question you asked has been resolved, please go to the top of the original post and click "Thread Tools" then select "Mark Thread Resolved."
If this Access... the query may still not be right.... DBO - is this a date field? I know it's stupposed to be a date going in, but is it stored as a date type field... or a string type field? If i'ts stored as a date, then dump the ' around it, and suround your date value with # instead:
"DOB = #" & txtMembership(11).Text & "#, " & _
it's possible you are trying to update a non-existent record.
Thanks everybody who took the time to look at this for me.
I have to admit that this was the problem.
I have another variable with a very similar name (good lesson here).
Originally Posted by Mark Gambo
Have you tried looking at the value of strSQL before it is executed? output the value of strSQL into the immediate window and then copy and paste it into an Access Query and see if it updates.
Could you explain a bit more about how to use the Access Query and what to expect from it.
A big thanks also to techgnome
If somebody helps you, take time to RATE the post. I do.
"FAILURE IS NOT AN OPTION. It comes bundled with the software."
Below are some of the threads that have helped me along the way:
. . .Could you explain a bit more about how to use the Access Query and what to expect from it.
A big thanks also to techgnome
Sure take a look at this graphic:
Regards,
Mark
Please remember to rate posts! Rate any post you find helpful. Use the link to the left - "Rate this Post". Please use [highlight='vb'] your code goes in here [/highlight] tags when posting code. When a question you asked has been resolved, please go to the top of the original post and click "Thread Tools" then select "Mark Thread Resolved."
Please remember to rate posts! Rate any post you find helpful. Use the link to the left - "Rate this Post". Please use [highlight='vb'] your code goes in here [/highlight] tags when posting code. When a question you asked has been resolved, please go to the top of the original post and click "Thread Tools" then select "Mark Thread Resolved."