Solved Runtime error 3075, missing operator error in SQL expression (1 Viewer)

Mike Krailo

Well-known member
Local time
Yesterday, 20:31
Joined
Mar 28, 2020
Messages
1,682
I'm not used to using the IN clause in SQL expressions so was wondering why I'm getting this 3075 error when trying to run an Update query on my table Media. The idea was to simply select media items from a list box (ListBox) and then run the query to update the Name and Date that the media will be destroyed. In this case the first three items were selected. Pretty simple, but for some odd reason, the following SQL doesn't pass the the syntax test. What's wrong with the SQL?

The following SQL is stored in variable strSQL and run with DoCmd.RunSQL strSQL

Code:
UPDATE Media SET DestroyedBy='Mike', DestroyDate=#6/29/2025# WHERE MediaID IS IN(1, 2, 3)

MediaID's 1 2 and 3 were selected in the listbox.

UPDATE: Nevermind, I see the error now. I removed the IS so it's now just using IN.

Code:
UPDATE Media SET DestroyedBy='Mike', DestroyDate=#6/29/2025# WHERE MediaID IN (1, 2, 3)
 
Last edited:
Mike, I don't think 'IS' is proper syntax.

Just found a sample: w3schools

SELECT * FROM Customers
WHERE Country IN ('Germany', 'France', 'UK');
 
Yes I realized my mistake shortly after posting. It was because the sample code I copy and pasted had that IS IN syntax which is wrong. I haven't used that clause for anything before so I was relying on the sample code. Thanks for looking at it.
 
Mike, I don't think 'IS' is proper syntax.

Just found a sample: w3schools

SELECT * FROM Customers
WHERE Country IN ('Germany', 'France', 'UK');
Well spotted. I looked at it, and could not see an issue. Then I tried it myself, but of course did not use the IS :(
 

Users who are viewing this thread

Back
Top Bottom