UPDATE JWXLSTBL SET Prov_ID = Auto – 1 + (SELECT Next_Prime FROM dbo_SEQUENCE WHERE DATABASE_ = ‘provider’);
When I run the above query in Access 97 or 2000 I get the message “Operation must use an updatable query”. The nested SELECT does yield exactly one value when run by itself. I am able to update the table JWXLSTBL, and it does have a column Prov_ID. I get appropriate results if I use a constant instead of the SELECT subquery.
1. What might I be doing wrong in SQL?
2. Is there a way of running the nested SELECT and putting the result into a VBA variable so that I can construct the UPDATE with a constant? This can be done in Cobol, but I cannot find a way of doing it in VBA.