473,499 Members | 1,533 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Create a record number in sequence based on criteria

1 New Member
I am building a database that requires a unique number assigned to it based on criteria. Example: One field is a drop down that says AIR/GND/OD, another is a YES/NO titled Recordable. If a person checks Recordable and AIR and it's the first entry of the type, the number would be "A001". If Recordable is not checked, then the number is left blank. How do I do that?
Oct 28 '13 #1
1 1889
zmbd
5,501 Recognized Expert Moderator Expert
gonzo1979:
Make your life simple and have one field for the [air/gnd/od]
Have a second field for the numeric portion
a calculated field in the query/form/report can combine the two fields with formating.
Once this is done, then build query/recordset that groups on the [air/gnd/od] field and returns the DMAX() of the numeric field.
It should be straight forward from there as to you code logic.

If you've already combinded the fields, then your code will have to filter out and parse the numeric from the string which is not straight forward however, one such examplehttp://bytes.com/topic/access/answer...-number-string you'll have to store the result, and step thru all of your records to find the next number in the series... IMHO, much easier to split the fields. This process will start to bog down as your database grows too!
Oct 29 '13 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

5
36741
by: Ken1 | last post by:
I am going to drop a primary key from one column and create a new column to be used as primary key in an existing database. The old column was a date column which someone earlier though was a good...
5
6098
by: Dan | last post by:
How can i find out what record number in the return set I am at? Example select *,recnum() from foo I would like to see recnum() be 1 then 2,3,4,5 and so on for each record returned.
3
13800
by: Michael Charney | last post by:
I have a form where records are entered. I have turned off the built in record control. I created buttons to advance and go back through the records as well as an add new record button, but I also...
3
14111
by: John Ortt | last post by:
> I have a table of dates in ascending order but with varying intervals. I > would like to create a query to pull out the date (in field 1) and then pull > the date from the subsequent record...
2
3807
by: chris vettese | last post by:
I've been searching for a few days and have't found the solution I'm looking for. I want to create the following in my form's header...Material: 1 of 15. The first number will change as the user...
0
8344
by: Carl | last post by:
I have a main form with navigation buttons on it and a label showing for example Record 1 of 15 using recordsetclone on it and eveything works fine. When I move through the records the record...
4
8817
by: James | last post by:
Hello there, Does anyone know how to create a sequential record number field in a query?? Thanks, James
1
5387
by: Scott269 | last post by:
So I've got an old MS Works database I imported into Access. I needed a primary key so I created a record number field that was just the record number I manually inserted when I entered it in the...
5
3813
by: slickdock | last post by:
I need to break my query into 3 groups: First 60 records (records 1-60) Next 60 records (records 61-121) Next 60 records (records 122-182) Of course I could use top values 60 for the first...
3
27696
by: Becker | last post by:
I have a form "Finish" which has a record source "finish query". Criteria for the query is that they must enter an item # to view only that record at that time. I want them to be able to just type...
0
7130
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7007
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7171
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7220
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7386
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4918
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4599
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3098
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
664
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.