Setting Values in a Form

barboza

Registered User.
Local time
Today, 17:52
Joined
Aug 22, 2007
Messages
23
We have a table called Custody Log that has Lab ID #s for every sample rec'd by our lab.

I want to set up a form for adding new samples to the table.
The Lab ID for a new sample is 1 greater than the last entered sample.

Last record in the table is 708005
How can I make the LabID field in the form automatically show 708006.

What I would like to have the form show is

Previous Lab ID: 708005
New Lab ID: 708006 and have the value 708006 be stored in the new record.
 
You can generate the next number using...
Code:
DMax("IDField", "YourTable") + 1
Maybe assign that value to the DefaultValue property of the control it belongs to.
 
I want to set up a form for adding new samples to the table.
The Lab ID for a new sample is 1 greater than the last entered sample.

Last record in the table is 708005
How can I make the LabID field in the form automatically show 708006.
This sounds like you need an autonumber. I explained the append process I use to start autonumbering at a certain point in this thread...http://www.access-programmers.co.uk/forums/showthread.php?t=134145
 

Users who are viewing this thread

Back
Top Bottom