parsing for null values

richard luft

Registered User.
Local time
Yesterday, 18:27
Joined
Jun 4, 2004
Messages
63
Hi:
I'm trying to use the following code:
>>>>>
rst.MoveFirst
MySQL7 = "UPDATE DISTINCTROW TBillDetails SET TBillDetails.InitBD1 = "", TBillDetails.LastBD1 = "" "
MySQL7 = MySQL7 & "WHERE ((TBillDetails.linenum = " & rst.linenum & "));"
---runSQL MySQL7
>>>>>>
When this runs, I get the following errmsg:
"Errors were encountered. 1 field cannot be updated due to type conversion failure, 0 records were not updated due to key violations, and 0 records were not updated due to lock violations. Proceed Anyway?"
I thought that it might be that my query would not like to make a field that is already null 'null', so I made it simpler. It got rid of the long-winded errmssg, but---
When I try to run a simpler form of the query:
Do Until rst.eof
MySQL7 = "UPDATE DISTINCTROW TBillDetails SET TBillDetails.InitBD1 = "" "
MySQL7 = MySQL7 & "WHERE (TBillDetails![linenum] = " & rst.[linenum] & ");"

DoCmd RunSQL MySQL7

I get errmsg of Syntax error in string in query expression "WHERE TBillDetails.linenum = 177;"

Can anyone give me a simple solution to this problem?
TIA, richard
 
Last edited:

Users who are viewing this thread

Back
Top Bottom