I am having problems wrapping my head on how to solve an issue with an update query.
The query is simple in that all it does it takes the revision number of the given form and increases it by one. The problem I have discovered is if you choose to start at an earlier revision and run the query from there, you end up duplicating a number.
Example:
Job 123456 has been revised 4 times, so there are 123456-1, 123456-2 etc.
When I am on 123456-4 and create another revision, 123456-5 is created BUT if I am on 123456-3, ANOTHER 123456-4 is created.
I believe I just need to use MAX() somewhere to make sure I get the highest number and then increment, but I am having a hard time with what should be a simple thing.
Here is my current SQL statement:
The query is simple in that all it does it takes the revision number of the given form and increases it by one. The problem I have discovered is if you choose to start at an earlier revision and run the query from there, you end up duplicating a number.
Example:
Job 123456 has been revised 4 times, so there are 123456-1, 123456-2 etc.
When I am on 123456-4 and create another revision, 123456-5 is created BUT if I am on 123456-3, ANOTHER 123456-4 is created.
I believe I just need to use MAX() somewhere to make sure I get the highest number and then increment, but I am having a hard time with what should be a simple thing.
Here is my current SQL statement:
SQL:
UPDATE tblQuoteDetails SET tblQuoteDetails.RevisionNum = [RevisionNum]+1
WHERE (((tblQuoteDetails.JobID)=[Forms]![JobQuote]![JobID]));