Runtime Error 3075

S

silkworm

Hi, I couldn't figure why my program throw an "3075" when it comes to
this line.

DoCmd.RunSQL "UPDATE CHIPLOT SET Comment = '" & CStr(TempComment) & _
"' WHERE ID = " & CLng(Me.LotList.Column(0,
Me.LotList.Value + 1)) & _
";"
From searching the archives of this group it seems likely that this is
a problem with the quote marks. But I am unfamiliar with the rules of
quotation marks in query statements. If anyone can point to a good
reference site for it, I would appreciate it.

Thanks
 
S

SteveS

The line looks OK. Are there any single or double quotes in "TempComment"?

One thing to try is to add a debugging line just above the DoCmd.RunSQL
line. You can use:

Debug.Print "UPDATE CHIPLOT SET Comment = ' " & CStr(TempComment) & " '
WHERE ID = " & CLng(Me.LotList.Column(0,Me.LotList.Value + 1)) & ";"

(Open the Immediate window in the debugger to see the results)

or

Msgbox "UPDATE CHIPLOT SET Comment = ' " & CStr(TempComment) & " ' WHERE ID
= " & CLng(Me.LotList.Column(0,Me.LotList.Value + 1)) & ";"


Most of the time I use Msgbox; I can check each string result before it gets
used. (Don't forget to remove or comment out the Msgbox lines after debugging
is done.)

HTH
 
V

Van T. Dinh

It looks to me that the error 3075 (application-defined or object-defined
error) is caused by the expression:

CLng(Me.LotList.Column(0, Me.LotList.Value + 1))

It looks strange to use the value of LotList to determine the required row
and then get the value of the 1st Column of the required row of LotList.

Describe in words what you meant by the above expression and what value you
need.
 
Top