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
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.
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: