473,378 Members | 1,421 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Create a record number in sequence based on criteria

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 1885
zmbd
5,501 Expert Mod 4TB
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
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
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
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
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
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
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
by: James | last post by:
Hello there, Does anyone know how to create a sequential record number field in a query?? Thanks, James
1
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
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
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.