473,420 Members | 1,603 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,420 software developers and data experts.

Automatically Generate Number On Form

I have a field on a form that I would like to automatically generate a
number, in sequential order, each time a new record is created, and be
stored in a field. The problem is that I do not want this field to be
an autonumber field because if a new record is opened by mistake and
then not used, the autonumber's field would not be in sequential order
any more. Is there a way to do this? Maybe something along the lines
of matching the actual record number that is displayed by the record
selection buttons at the bottom of the page? Any ideas on this would
be greatly appreciated. Thanks!

Nov 14 '05 #1
2 15756
I've got a free sample Access invoices database that does this on the
invoice form (frmInv) that you can download from my site and possibly
use as a starting point for your database:

www.Bullschmidt.com/Access

And the trick to making it work is this in frmInv's InvNum control's
DefaultValue property:

=Nz(DMax("[InvNum]","tblInv"))+1

Best regards,
J. Paul Schmidt, Freelance Web and Database Developer
http://www.Bullschmidt.com
Access Database Sample, Web Database Sample, ASP Design Tips
I have a field on a form that I would like to >automatically generate a
number, in sequential order, each time a new record >is created, and be
stored in a field. The problem is that I do not want >this field to be
an autonumber field because if a new record is >opened by mistake and
then not used, the autonumber's field would not be in >sequential order
any more. Is there a way to do this? Maybe >something along the lines
of matching the actual record number that is >displayed by the record
selection buttons at the bottom of the page? Any >ideas on this would
be greatly appreciated. Thanks!


Nov 14 '05 #2
Paul,

The DMax command did the trick! I appreciate it! :) Take care!
Jonathan

pa**@bullschmidt.com wrote:
I've got a free sample Access invoices database that does this on the
invoice form (frmInv) that you can download from my site and possibly
use as a starting point for your database:

www.Bullschmidt.com/Access

And the trick to making it work is this in frmInv's InvNum control's
DefaultValue property:

=Nz(DMax("[InvNum]","tblInv"))+1

Best regards,
J. Paul Schmidt, Freelance Web and Database Developer
http://www.Bullschmidt.com
Access Database Sample, Web Database Sample, ASP Design Tips


Nov 16 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Sami | last post by:
Please bear with me, and if you answer this question, please do it step by step. I am new at Access, not at all sophisticated. I am using Office XP. This will need to be read in Access for...
2
by: fkealty | last post by:
I'm attempting to make a small user database more efficient. I have an employee table with id numbers, last name first name title and address. Using a combo box I select the last name and have...
6
by: HD | last post by:
Hello. For the following, I would appreciate if anyone could tell me: if it can be done, how it might done, and/or what search terms I could use to find the solution myself. I would like to...
1
by: Frankie | last post by:
Hi, In my form users must enter data about new employees. One of the fields is the birthdate of an employee. The next field is a registration number that looks like this: 0YYMMDD. 0: first...
11
by: Gary | last post by:
I'm using Access 2002. I have a field called Job No. It is a text (data type). The reason being that there is an "I" in front of each number i.e. I1234 I1235 etc The problem is that when...
9
by: Nooby | last post by:
New to Access here. I inherited a db that has the first column as an automatically generated sequential number. I want to bump it up, but for the life of me I can't figure out how to do it. Is...
14
by: dan | last post by:
I would like to have the preprocessor automatically generate the number of array elements requested. Each element is zero. The elements get pasted into a larger array. The other elements may be...
1
by: DanielLauJJ | last post by:
When inserting a record into a table, I want SQL Server to generate a number automatically for the Primary Key. (e.g. OrderID is 1, 2, 3 and so on) How to do it? (This behavior is similar to the...
6
by: GLEberts | last post by:
Novice looking for some direction!! I am trying to have a text box autopopulate with a number added to it at the end and I am having a difficult time doing this. Example: (1) I have a combo...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...
0
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
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,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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
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...

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.