This is a discussion on "Ms Access.... Custom Autonumber Format" within the Databases section. This forum, and the thread "Ms Access.... Custom Autonumber Format are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
Ms Access.... Custom Autonumber Format
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
Ms Access.... Custom Autonumber Format
Hi all.......I'M Using Ms Access to develope a db...which I want to set an autonumber format like this "FAMAOR-YY-XXXXX"....The YY = Year and the xxxxx = autonumber...and the example of generate autonumber should be like this "FAMAOR0200001".....can anybody
tell me how to do this |
|
|
|
|||
|
We'll I'd say you'd want to use the regular autonumber for one of the fields in the table. Then after you've added the record, grab the autonumber generated and format it into your index string with the year and leading zeros, which you would then update your record with using the autonumber as the identifying key.
Basically 2 steps needed, at least for Access anyway. |
|
|||
|
Hello Catalyst......Thanx for reply but can tell a little bit more on how to do this coz I'm kindda new in this whole db thing and I aslo don't have a clue how to do the string at all......may god bless you for your help
|
|
|||
|
What language are you using with Access?
|
|
||||
|
I can only presume VBA
__________________
Rob - SEO Specialist Owner & Founder of Webforumz.com I am currently unavailable for private work
Last Blog Entry: Creative Labs threaten developer over home made drivers.... (Apr 1st, 2008)
|
|
|||
|
I'm using Vba.....but the problem is also not very good in programming
|
|
|||
|
Here's sample code for doing this in vba:
http://www.experts-exchange.com/Data...2.html#7747320 You might need to signup for a free membership to view the code. If you have questions about the sample code just ask. |
|
|||
|
Hi guys, still need help here
so for example I have a wheel table... wheelID(pk), wheelName, wheelSize, etc. the other table is the autoIncrement which consist of two fields: perfix (pk, text) and increment(autonumber) the format for wheelID is W"wheelsize"-"0001" and so on for example W17-00001, W17-00002, W18-00010, W19-00001 the problem here, I dont get what the codes are doing :mad: ---- code start -------- Dim wheelID As String Dim db As Database "when I run the program, theres an error here - user defined type not defined" Dim autoNumber As Recordses wheelID = "V" & *i dont know how to get wheelSize* & "-" (will this go to table Whell.wheelID?) Set db = CurrentDb() Set autoNumber = db.OpenRecordset("increment") autoNumber.MoveFirst autoNumber.Edit autoNumber!increment = autoIncrement!increment + 1 autoNumber.Update wheelID = wheelID & Format(autoNumber!increment, "00000") *is this the way to get the increment value from table autoIncrement?* autoNumber.Close ----- code end ---------- this coding doesnt seem to work. in vba coding part, where do I put this coding? on form load event ? or on form current event? Thanks in advance guys |
|
|||
|
i've got it working now
|
![]() |
| Tags |
| format, autonumber, custom, access |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| ASP Multi users Access to Microsoft Access | ish | Classic ASP | 0 | Apr 26th, 2007 20:05 |
| Access Autonumber Start Value | redkyna | Databases | 2 | Aug 25th, 2004 06:08 |
| Access Autonumber | redkyna | Databases | 2 | Aug 24th, 2004 09:37 |
| Update autonumber field in Access Database | redkyna | Databases | 3 | Aug 20th, 2004 09:18 |
| Format Auto Number in MS Access 2000 | dretzka | Databases | 2 | Aug 10th, 2004 13:37 |