473,769 Members | 7,097 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Sequential numbering

how can I set a form so that when i open it , it appears with the next
sequential number. I want to set the number pattern and not use
autonumber
Nov 12 '05 #1
4 2971
Cliff,

Say you have a TblCustomer table with a CustomerNum field. You have a
FrmCustomer based on TblCustomer and the form has a textbox bound to the
CustomerNum field. Put this expression in the Default Value property(Data tab)
of the textbox:
DMax("[CustomerNum]","TblCustomer" )+1

When you enter something in any field in the form and save the record,
CustomerNum will automatically have the next sequential number.
--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
re******@pcdata sheet.com
www.pcdatasheet.com
"cliff williams" <cw*******@mult ipak.com> wrote in message
news:78******** *************** ***@posting.goo gle.com...
how can I set a form so that when i open it , it appears with the next
sequential number. I want to set the number pattern and not use
autonumber

Nov 12 '05 #2
On Thu, 11 Dec 2003 20:57:45 GMT, "PC Datasheet" <sp**@nospam.co m>
wrote:
Cliff,

Say you have a TblCustomer table with a CustomerNum field. You have a
FrmCustomer based on TblCustomer and the form has a textbox bound to the
CustomerNum field. Put this expression in the Default Value property(Data tab)
of the textbox:
DMax("[CustomerNum]","TblCustomer" )+1

When you enter something in any field in the form and save the record,
CustomerNum will automatically have the next sequential number.


If this is a multi-user environment (or could become one) it is better
to apply the sequence in the Before Insert event.

More than one user could be adding a record with the same CustomerNum.
Besides, the id has no relevance until a record is created.

- Jim
Nov 12 '05 #3
I assume the form is linked to a table or is adding data to a table . .

so if the table is called tbl_INFO with a key of INFO_KEY (long number )
then you can get the next key number with

NextNumber = Dmax("[INFO_KEY]","tbl_INFO ") + 1

I use this all the time even if the key is set to autonumber . . as it gives
the key to the new record for use elsewhere in any required code.

hope this helps
cheers
paul g

"cliff williams" <cw*******@mult ipak.com> wrote in message
news:78******** *************** ***@posting.goo gle.com...
how can I set a form so that when i open it , it appears with the next
sequential number. I want to set the number pattern and not use
autonumber

Nov 12 '05 #4
The DMax domain aggregate function can be used to get the highest value in a
field in a table, and you can increment that to create the next one. Of
course, you want to be sure you do this only for new records... a little
slipup and you might overwrite existing key fields.

Larry Linson
Microsoft Access MVP
"cliff williams" <cw*******@mult ipak.com> wrote in message
news:78******** *************** ***@posting.goo gle.com...
how can I set a form so that when i open it , it appears with the next
sequential number. I want to set the number pattern and not use
autonumber

Nov 12 '05 #5

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

Similar topics

0
1543
by: Robert Kilroy | last post by:
Greetings, I've been working on a project for my church for a couple of weeks. We're going to be selling tickets to our events and we need to look for available seats in our hall. I have a query that returns to me all the seats that are available, which is great but the ideal solution would be to return X number of seats based on a seatnum (Integer).
0
1566
by: Lynn | last post by:
I have a query which shows start date and the last 4 digits of a person's SSN. I need sequential numbering of an assending start date yet desending last 4 digits of SSN (L4SSN). Using: RowNum: (Select Count (*) FROM as Temp WHERE . < .)+1 I can get close to what I want, but in case of ties, this just gives me the same number, i.e. 1, 2, 2, 4, 5, 6, 6, 6. I want to refer to desending order of L4SSN for sequential numbering in case of...
1
17820
by: systems analyst | last post by:
This is my modification on an original solution posted by Trevor Best (trevor@microprism.com) back in 1996. Insert the following code in a Module in your Access data base. Option Compare Database Option Explicit Dim mlngCounter As Long Function ZeroCounter() mlngCounter = 0
4
8839
by: James | last post by:
Hello there, Does anyone know how to create a sequential record number field in a query?? Thanks, James
14
12048
by: amywolfie | last post by:
Hi All: I know this is simple, but I just can't seem to get there: I need to sort a table by a text field (txtDescription), then assign sequential numbers to the field SEQUENCE in table. Every time a new record is added, the all SEQUENCE #'s must be reset. The re-numbering will be triggered by an EXPORT button.
1
1467
by: S. van Beek | last post by:
Dear reader, Is there a function to use in a query for numbering the records starting with one (1) and then second (2) and so on? Thanks for any help
0
1287
by: palmorek | last post by:
I am trying to build a macro in Excel for the purpose of authorizing checks. I am trying to figure out when the user is done entering their information they hit an enter button and the macro will assign an authorization number for that particular check. My delimma is sequential numbering. I found the following code. Public Function NEXTSeqNumber() Const sDEFAULT_PATH As String = "S:\Accounting\KPalmore" Const sDEFAULT_FNAME...
19
4167
by: eric.nave | last post by:
this is a slight change to a fequently asked question around here. I have a table which contains a "sortorder" column where a user can specify some arbitrary order for records to be displayed in. Users have sometimes ordered records the way we used to number lines in a BASIC program (10,20,30, etc.). I'd like to do an update query and fix this so that every record is in sequential order. I found an example in this newsgroup of how to...
1
1689
by: wbw | last post by:
I have a database of products in which I have determined when the product sold. The table has two fields ITEM and SOLD. Each product’s first selling date may be different and may not have sold in every week. I need to assign a sequential numbering pattern since the product was first introduced. A new field, SEQNO, needs to be created to show 1 for the first time, 2 for the second time, 3 for the third time… etc. I would like to benchmark...
0
9589
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9423
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10214
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9996
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9865
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8872
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7410
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6674
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.