Auto Increment Ticket Number

G

Grassy7

I've looked everywhere for help and advice on how to auto increment a
Ticket Number on my form. I haven't found anyone who can put me in the
right direction.

On my form I want the TransactionID (=Ticket Number) to increment by 1
based on the previous number in the Transactions Table. Easy, for that
part, however, I want it to increment based also on the ToJobsiteID.
Example: I'm shipping items to JobsiteID 520; this is the very first
ticket so the TransactionID would be "001" for this particular Jobsite;
I click my "Add New" button and select JobsiteID 533; this is the 10th
ticket so the TransactionID would be "010".

I know the logic of what I want, but can't get it into the code. I
know I want the code in the AfterUpdate property of the "ToJobsiteID"
control. Basically, Access needs to look up the Maximum TransactionID
under each JobsiteID and increment by 1.

Need a little help.
 
L

Larry Daugherty

Look in Access Help for DMAX(). The solution is to make the new
ticket number - DMAX() + 1

HTH
 
A

aaron.kempf

why not use autonumber?

i mean seriously here??

Access Data Projects have identity fields that are much much much more
powerful
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top