The expression: Nz(DMax(“[PONum]”,”tblPO”),0)+1 will check if a PONum already exists. If it doesn’t it returns a 1, if it does it returns the number incremented by 1. If the number exists, but is 0 it will return a 1. In my blog I advise that number should NOT be generated until the user is ready to save the record. And to immediately commit the record after generating the number. Therefore, there should be no issue about giving them a new number if they go back to it.
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.
This is how I see it. A person (passenger) makes a reservation. If the person has never made a reservation before, then they are added to the passenger table, But it really makes no sense to assign a sequential number to the passenger. Otherwise, an entry, just needs to be made in the reservations table. The Reservation needs to include the specific train (number and date so there should be a table for train schedules so all you need is a foreign key), the passenger and date of travel. Here I can understand wanting a sequential number to show passengers booked in a day.
Ontario has the oldest exit number system, having started posting exit numbers sequentially in the 1960s along Highway 401; it switched to mile-based numbering before Canada went metric. Most short freeways do not have exit numbers, and until about 2000 (with Highways 11 and 69/400), incomplete freeways also did not have exit numbers. Interchanges with multiple exits are lettered A-B.
You can change the numbers in the list by restarting the sequence or by specifying a new start number. You can change the list's style. You can do anything to this list that you can do to a normal numbered list because it is a numbered list, with one exception: the list, while easy to format, is fixed. If you delete an item, the list updates accordingly, but I haven't found a way to add numbers.
In this scenario we are assuming that there will be no more than 999 documents attached to a case. In Scenario 2 we assumed no more than 9999 inquires during a year. So you need to adjust the number of zeros when formatting Sequence for the anticipated number of records. Of course this can always be changed later. You also don’t need to format the sequence with leading zeros as the Format function does. As shown the expression returns something like: DCASD/CI123-025 for the 25th document in case CI123 for client DCASD. Without leading zeros it would be: DCASD/CI123-25. The advantage to the latter is that you don’t have to anticipate the number of records you might have in the sequence, but I’ve found many users prefer a more uniform number with the leading zeros.
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!
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.
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.
Next we will look at scenario 2. The variation here is that Apex wants to start each year with anew sequence of numbers. Also, they want to include the year when displaying this number. We still use a DMax, but we need to add criteria to determine the year. So Apex needs to have a field in their table that indicates the date. Generally, such inquiries will have a date/time stamp to indicate when received or the user will input the date and time. So we will assume there is a field in record called InquiryDate. We will also add an Integer field named Sequence. On the form we will add a control bound to Sequence, but set its Visible property to No. The line of code will look like this:
Thanks for the quick reply, I think I’m a little confused by the Display aspect of this. Artifact ID is a primary key to the table I am working in and I need it to have a unique identifier that other people can search for. The previously adopted naming convention for this ID is that which I mentioned before, Collection Point ID plus a period and then a sequential number restarting at each new Collection Point ID i.e 2-1050.1, 2-1050.2, 2-1060.1 and so on. So I think I actually need to save this in the Artifact ID field. I realize this might be slightly redundant but I’m not sure how the display would work as far as searching for specific Artifact IDs in the future.
To enter specific sequential number codes, such as purchase order numbers, you can use the ROW function together with the TEXT function. For example, to start a numbered list by using 000-001, you enter the formula =TEXT(ROW(A1),"000-000") in the first cell of the range that you want to number, and then drag the fill handle to the end of the range.