If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
using sequential numbers for documents
Your help please. I want to sequentially number a series of receipts, for
customers who buy from us. I have set up a form to select the product (work of art) and I have also set up a Report to print the Receipt. Two questions - How and where do I store the coding to generate a sequential number for the receipts? Second question is there a more user friendly way to select the record to be printed than using a Query. Final question (that's three), what code should I use ? I am new to Access. I've got this far OK, but I cannot work out a solution to the above. Thank You. |
#2
|
|||
|
|||
using sequential numbers for documents
There are so many different ways to do this. Keep in mind, however, that if
a record in the sequence is deleted, a hole will remain that must be ignored or manually filled, Probably the easiest way is to look and see what the last number is and add 1 to it. Use this to create a default value for that record, so it won't be used unless you start typing the record: Private Sub Form_Current() On Error Resume Next Dim x As Integer x = DMax("ProviderNumber", "tblProviders", "ID =" & Me.txtID) If IsNull(x) Then Me!txtProviderNumber.DefaultValue = 1 Else Me!txtProviderNumber.DefaultValue = x + 1 End If End Sub -- Arvin Meyer, MCP, MVP http://www.datastrat.com http://www.mvps.org/access http://www.accessmvp.com "snimmuc" wrote in message ... Your help please. I want to sequentially number a series of receipts, for customers who buy from us. I have set up a form to select the product (work of art) and I have also set up a Report to print the Receipt. Two questions - How and where do I store the coding to generate a sequential number for the receipts? Second question is there a more user friendly way to select the record to be printed than using a Query. Final question (that's three), what code should I use ? I am new to Access. I've got this far OK, but I cannot work out a solution to the above. Thank You. |
Thread Tools | |
Display Modes | |
|
|