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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Incremental/Auto-Number w/Combo Box selection???

Status
Not open for further replies.

mjones219

Technical User
Jun 26, 2002
9
US
I have an Assignments Table (tblAssignment) that I need to have incremental numbering on a field so that each record has a unique number. However the numbering is alpha-numeric:
YYYY-xxx-0000
where YYYY = the current year (4-digits);
and xxx is 3-alpha-characters limited to a select list;
and 0000 is the incremental number up to 9999 (we will never have more than 9999 of any of these based upon the alpha characters)

For example: 2002-COI-0145; 2002-COI-0146; 2002-PAI-0145
I would like to have the 3-alpha-characters be selected from a combo box (?) limited to the list.

?Is this feasible?, and if so how?
?Also, can I use this as my primary key?, and if so how should I set this up?

Thanks.(-:
 
You can load the combo box in one of two ways:

1. If the 3 alpha characters are stored in a table, you could load the combo box with a Select Distinct Query on that field.

2. If the 3 alpha characters aren't stored in a table and are known and fixed, you could store them in the combo box as a Value List.

You could use this as your primary key, but I'd recommend that you create an ID field that is AutoNumber type, and use that as your primary key. Is this table related to any other tables? dz
dzaccess@yahoo.com
 
Yes it is related to other tables including a tblStaff, so, as assignments are created they get a unique number and are assigned to a staffmember.
 
I have also added this info to thread702-284611 because I was browsing and saw a post that appeared to be similar.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top