M martlewis Registered User. Local time Today, 20:29 Joined May 3, 2011 Messages 20 May 5, 2011 #1 How do i take a value from a field in the previous record and increment it then put it to the same field in the current record? Cheers.
How do i take a value from a field in the previous record and increment it then put it to the same field in the current record? Cheers.
jdraw Super Moderator Staff member Local time Today, 15:29 Joined Jan 23, 2006 Messages 15,533 May 5, 2011 #2 Allen Browne has several tips for Access. Here is one about subqueries http://allenbrowne.com/subquery-01.html see the example of Get the value in another record You can also use DMax() eg dmax("FieldName", "TableName") + 1 see http://www.techonthenet.com/access/functions/domain/dmax.php Last edited: May 5, 2011
Allen Browne has several tips for Access. Here is one about subqueries http://allenbrowne.com/subquery-01.html see the example of Get the value in another record You can also use DMax() eg dmax("FieldName", "TableName") + 1 see http://www.techonthenet.com/access/functions/domain/dmax.php
M martlewis Registered User. Local time Today, 20:29 Joined May 3, 2011 Messages 20 May 6, 2011 #3 Dmax worked perfectly as every year I start the invoice numbers with the year (eg 20110001, 20110002, etc.) I can change the first invoice number of the year and the rest of the year now carries on from there. Thank you for that.
Dmax worked perfectly as every year I start the invoice numbers with the year (eg 20110001, 20110002, etc.) I can change the first invoice number of the year and the rest of the year now carries on from there. Thank you for that.
C CanWest Registered User. Local time Today, 13:29 Joined Sep 15, 2006 Messages 272 Jul 22, 2011 #4 jdraw said: You can also use DMax() eg dmax("FieldName", "TableName") + 1 Click to expand... Would you know how to make that loop through a set of records in a query to place a value that was increased by one in every record
jdraw said: You can also use DMax() eg dmax("FieldName", "TableName") + 1 Click to expand... Would you know how to make that loop through a set of records in a query to place a value that was increased by one in every record
F fleurette Registered User. Local time Tomorrow, 03:29 Joined May 6, 2013 Messages 18 May 7, 2013 #5 jdraw said: Allen Browne has several tips for Access. Here is one about subqueries see the example of Get the value in another record You can also use DMax() eg dmax("FieldName", "TableName") + 1 Click to expand... I tried using the above e.g. in my situation. Expr1: DMax([Serial Number],[Policy Information])+1 but I am getting an error message. Serial number has data like, 0001, 0002, 0003 and policy information is my table. any one can help with what's wrong with the syntax? thanks
jdraw said: Allen Browne has several tips for Access. Here is one about subqueries see the example of Get the value in another record You can also use DMax() eg dmax("FieldName", "TableName") + 1 Click to expand... I tried using the above e.g. in my situation. Expr1: DMax([Serial Number],[Policy Information])+1 but I am getting an error message. Serial number has data like, 0001, 0002, 0003 and policy information is my table. any one can help with what's wrong with the syntax? thanks