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

Customize AutoNumber After Update

Status
Not open for further replies.

mp3nick

Programmer
Feb 10, 2003
14
0
0
MY
Hi everybody

I need to generate a customize autonumber for my fields

I got MovieID field and MaterialFormat field which is optional with "DVD, VCD, BetaTAPE, VHS Tape" and by choosing each one of them I need to generate the number like this for MaterialID field.

<MovieID>&quot;-&quot;<10000 for DVD, 20000 for VCD, 30000 for BetaTape,40000 for VHS Tape> <autonumber>

thanks alot

PS: is there any space in here to upload my database ? its only 250 kb
 
Hi

Why include all of the DVD etc in the autonumber?, in the table keep them as seperate columns, make a query which contains a 'calculated' column to show the data you want so:

RecordId:[RecordType] & [Autonumber]

where [REcordType] is the name of the column holding &quot;DVD&quot;, &quot;MovieId&quot; etc and [Autonumber] is the name of the autonumber column, and RecordId may be any name you wish, which is not already included in the query


Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
thanks for your reply
but here I need this ID for the Materials to put in library, my boss said I need every material have a Unique Code, I want to generate the unique standard Code by that formula in other Field in the same table.

thanks again


PS: this is what I mean but I dunno how to do the Autonumber and where to put this damn thing, I was using EXCEL VBA before and here in access its quite Different, Please help me


Select case MaterialFormat
case = &quot;DVD&quot;
MaterialID = 1000 + <Autonumber started by 0 and no duplicated>
Case = &quot;VCD&quot;
MaterialID = 2000 + <Autonumber started by 0 and no duplicated>
Case = &quot;VHSTape&quot;
MaterialID = 3000 + <Autonumber started by 0 and no duplicated>
Case = &quot;BetaTape&quot;
MaterialID = 4000 + <Autonumber started by 0 and no duplicated>

etc
 
Hi

The autonumber itself is a unique code without all the DVD etc. THe thing to do is to have the autonumber which the COMPUTER uses as the unique code, what you show to the user is quite a different thing

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top