Need help w/ Custom Primary key with letters and numbers?

  • Thread starter Thread starter Vandat Ng. via AccessMonster.com
  • Start date Start date
V

Vandat Ng. via AccessMonster.com

Hi all,
My name is Dat, QC Inspector
I need help on create a Custom Primary Key with letters and numbers?
(example Lot Number: 75AE1101, 75BD0401, etc..) to use in a multiuser
environment.

1. I need to create a separate table that will maintain the next available
lot number. This table will have one field and one record, with the value
of the next available lot number.

2. In my form within Access, I need to create a command button to call this
table and retrieve the value stored there. Each time the command button
"Next Lot No." is click, increment the value retrieved and store the number
back into the table as the next available lot number.

Can someone help please.
Thanks
 
Hi all,
My name is Dat, QC Inspector
I need help on create a Custom Primary Key with letters and numbers?
(example Lot Number: 75AE1101, 75BD0401, etc..) to use in a multiuser
environment.

1. I need to create a separate table that will maintain the next available
lot number. This table will have one field and one record, with the value
of the next available lot number.

2. In my form within Access, I need to create a command button to call this
table and retrieve the value stored there. Each time the command button
"Next Lot No." is click, increment the value retrieved and store the number
back into the table as the next available lot number.

Can someone help please.
Thanks

How does this field increment? Is it a composite field - i.e. do the
75, the AE, and the 1101 all have some independent existance?

The code for your button (or for the Form's BeforeInsert or
BeforeUpdate event, as you prefer) is available in the software
provided with the Access Developers Handbook from Sybex; I'm sure
there are examples on the web as well (search for "custom counter").

John W. Vinson[MVP]
 
Back
Top