As you can see, an idea of sequential numbering can be solved many different ways using different domains. This is typical in this field of work and precisely why it pays to not just consider how you can do it in one domain but also whether the domain is the right domain. We saw how we can easily leverage built-in features such as Transact-SQL’s ROW_NUMBER() or Access report’s Running Sum property. We also not only saw how we can craft our custom solutions in either VBA or SQL but we also see how we can use both together to create a solution that is better.

Hi Scott, I had a question regarding the sequential numbering Apex example…I am looking to automatically restart the sequence every month, which is not a problem using your example (i.e. changing the year to month in the expression). However, I would also like to add in a condition for year, so that the sequence restarts for each month of each year (i.e. my problem is for example that Feb 2011 last sequence number is 5, and then in Feb 2012 this becomes 6, where I would like it to be 1). I am wondering what the syntax would be. Thanks in advance, Lawn.
Search sequential numbering and thousands of other words in English Cobuild dictionary from Reverso. You can complete the definition of sequential numbering given by the English Cobuild dictionary with other English dictionaries : Wikipedia, Lexilogos, Oxford, Cambridge, Chambers Harrap, Wordreference, Collins Lexibase dictionaries, Merriam Webster ...
Thanks very much for this. I have done the two button arrangement using cut and paste but I must be quite thick as I can't get it to work. What I would like to do is select the blocks and have numbers put in each one preferably without having to edit each one. If this is what the macro does how do I make it work? I'm not used to working with macros so need basic instructions.

Let’s look at why we have this setup. It seems strange to put a ResetRowNumber() call in a WHERE clause, doesn’t it? However, the WHERE clause is actually resolved prior to the SELECT clause. (For those who wants to geek out on SQL internals, Itzik Ben-Gan, a SQL Server MVP has a great post that outlines the logical query processing. Though this is specific to SQL Server, the Access database engine as well the majority of RBMS engines generally follow the same outline). This gives us a convenient point to ensure that the module level variable lngRowNumber is always correctly reset at the right time (e.g. before we start returning records from a query).
Yes, I have used this system in a multi-user setting. As noted, the key is to commit the record immediately after generating the sequence. However, if the application is one where there is very heavy transaction processing. In other words dozens of users creating records simultaneously, you might want to guard further against duplication. At the speeds computers process, it is not impossible that multiple users will grab the max value before it can be incremented and saved.
For whatever reason, AllExperts did not let me post a direct reply to your response re: “Ok, what is the ControlSource of the Fixture Number control? It should be: =cboZone & “-” & Format(Me.FNumber,”000″)” and adding “Me.Refresh” to my code (within the last 10 minutes). It just had the “rate this reply”. I added the Me.Refresh and corrected my location of the =cboZone code and it works correctly now.
I've read a few posts which I thought would cover this but haven't been able to make anything work. Basically I have a piling layout with 350 piles on it which have to be numbered. I have done this by block and attribute and can edit the number to each one individually. However, If one pile gets added I have to renumber the subsequent ones to have a logical sequence for the builder. Not too much of a problem if is near the end of the numbers, but a real pain if it is near the top. The piles are not on  a regular grid either so I can't just select and move the numbers en bloc. Is there any way to speed this up in Acad LT 2013? It would save me hours of editing time.
I've read a few posts which I thought would cover this but haven't been able to make anything work. Basically I have a piling layout with 350 piles on it which have to be numbered. I have done this by block and attribute and can edit the number to each one individually. However, If one pile gets added I have to renumber the subsequent ones to have a logical sequence for the builder. Not too much of a problem if is near the end of the numbers, but a real pain if it is near the top. The piles are not on  a regular grid either so I can't just select and move the numbers en bloc. Is there any way to speed this up in Acad LT 2013? It would save me hours of editing time.
As I indicated, because you want to only generate this number just before saving, I would put this code behind a Save button or another event that runs just before you save the record. So if you want to prevent duplications, you don’t use the expression as a control source, but put the code behind a button or event. Since you have a Save button, put it there.

Scott, I had posted on Microsoft and you sent me to your blog to have the numbering system (similar to APEX example) explained. I am not a programmer and I don’t understand where these codes and expressions are even suppose to go in access. When I do try to implement the little I do know I continue to get errors. I am not sure if I am putting the information in the wrong place or if I am way off. Do you know of any youtube videos that could walk me through it step by step? Or if you have the time could you help walk me through the steps.

English Spanish Dictionary | English Italian Dictionary | English German Dictionary | English Portuguese Dictionary | English Russian Dictionary | Medical dictionary English French | Computer dictionary English French | Computer dictionary English Spanish | Business dictionary English French | English Arabic Dictionary | English Hebrew Dictionary | English Dutch Dictionary | English Polish Dictionary
Search sequential numbering and thousands of other words in English Cobuild dictionary from Reverso. You can complete the definition of sequential numbering given by the English Cobuild dictionary with other English dictionaries : Wikipedia, Lexilogos, Oxford, Cambridge, Chambers Harrap, Wordreference, Collins Lexibase dictionaries, Merriam Webster ...
Some sequential exits are renumbered (remaining sequential) due to added exits. For instance, the Hutchinson River Parkway in New York was renumbered so that its northernmost exit, 27, became 30. However, the Merritt Parkway, which continued the Hutchinson's exit numbers in Connecticut, was not renumbered. This means the Route 120A interchange is numbered 27 in Connecticut and 30 in New York.
Thanks very much for this. I have done the two button arrangement using cut and paste but I must be quite thick as I can't get it to work. What I would like to do is select the blocks and have numbers put in each one preferably without having to edit each one. If this is what the macro does how do I make it work? I'm not used to working with macros so need basic instructions.
First, you have to use YOUR field and control names. The ones I use are samples. The error you are getting indicated you do not have a control named txtProject. So you have to substitute the correct name of the control. bound to the ProjectID field. By the way it is not a good idea to the octothorpe(#) as part of a field name. A controlname may be different from a fieldname. The name property of a control is on the Other tab in the Properties dialog.
You may be familiar to view multiple webpages in Firefox/Chrome/IE, and switch between them by clicking corresponding tabs easily. Here, Office Tab supports similar processing, which allow you to browse multiple Excel workbooks or Word documents in one Excel window or Word window, and easily switch between them by clicking their tabs. Click for free trial of Office Tab!
Some freeways' exit number starts from a advanced number (i.e. higher than 1). Some reason of starting a number higher than 1 is due to the expectation that the highway will extend on both ends. For example, Ontario Highway 400 starts at 20 because it was expected that the south end of the highway would extend to downtown Toronto (which was never built). Another reason to use a higher number is that the freeway is branching off from another freeway. An example is British Columbia Highway 5, which branches off British Columbia Highway 1 and starts at 170.
To recap, you use a DMax function to return the highest number in the Sequence and increment it by 1. You assign the incremented number to a control on your form and then immediately save the record. If your identifier includes additional information from the record, you use an expression that concatenates that information with the sequence number to display the full identifier.
If you use the Form Wizard, controls will be named with the field name the control is bound to. But that name can be changed. This trips up a lot of people because my code samples use a naming convention that is not what is automatically generated. So you just need to make sure you use the correct name for the object. The name is shown in the Name property on the Other tab (Not the Caption property). To determine what field in your table the control is bound to check the ControlSource property. It should be bound to the PONum field.

The Artifact ID should NOT be your PK. There is no reason for it to be and to try and use it as such will be a headache. A primary key is simply a unique identifier for a record. Many purists will tell you that users should never see the PK and in your case, I would recommend that. Use an Autonumber as you PK and you can use that as your corresponding Foreign Key in related records. To prevent duplication you can make the combination of Collection Point ID and Artifact ID a unique, multi-field index. Then display the combination as I indicated where you need to show the user a record ID. This is all explained int he blog.
One other thought. It may not hurt to make option 1 a logical expresssion where it will update the number IF a number other than 0 already exists for it. This will prevent it from giving a new number if you go back, edit it and save it. I accomplished this by adding the following (roughly): If PONo=0 Then My.PONo…. (Expression and save command) Else (Save Command)
Ok, generating a random 3 digit number is a whole different thing, so I’m not going to go into that. If you want your numbers to start at 100 (to insure three digits) then change the 0 to 99. The Nz function will return the value listed if the field is Null. So the first time you execute that code, the DMax should return a Null since no numbers have been generated for the PONum field. The Nz will then substitute 99 and then increment that by 1. You can accomplish something similar by just entering 100 as the PONum for one record. .

There’s an old Steve Martin joke about how to make a million dollars which starts, “First, get a million dollars…” That’s the key to this trick, too: First, get a bunch of numbers. Here’s a file with 1,197 numbers in it. Now import or paste those numbers into a thread so that the numbers appear in the right place. If you need two matching numbers, just import it twice.

×