Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Auto-incrementing without using Autonumber...

Status
Not open for further replies.

somewhereelse

Technical User
Mar 26, 2003
8
US
I was told once that I could make a macro using the max funcion and setvalue to automatically increment a field when a new record is created, but I can't figure out how to do it...
The numbers I want in the field are not the same as the numbers in the Autonumber field that is already present, but I do want it to count from 1 to the number of records that are in the table.
[bomb]
 
if you email me at frank@fhsservices.co.uk

I will send you a small sample that shows the method
 
what i'm looking to implement may be similar to the goal of the original author, altough i would be altogether unsurprised if it were not.....

in a table (or form) where the primary keys are person_id and lesion_number a user can enter up to ten records worth of information. it is not known ahead of time how many records (of the ten possible) will be entered, but at this point, the user is required to actually enter the value of the lesion number, which by the way is simply the incremental counter 1,2,3,....all the way up to 10.

can ms access 2000 auto complete the lesion number field each time the user request the creation of another record for any value of person_id. i don't think calling lesion_number an 'autonumber' field would work, would it, because as i see it, that property would be sequential ad infinitum -- meaning that once the second person's person_id got entered, assuming the first one required using lesion_numbers up to 10, the second one's would begin with lesion_number 11.
 
What you need to do is to get the next number based on the person_id, so for each person_id there will be a range of numbers that reflect the number of lesion entries.

Email me at frank@fhsservices.co.uk and I'll forward the sample
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top