[AccessD] Re: Add records with sequential numbers

Robert L. Stewart rl_stewart at highstream.net
Tue Feb 24 10:31:40 CST 2004


Gina,

The simple way is to create a table with all of the invoice number she 
could use.  As they are used delete them.  Use the autonumber field as the 
PK and set the Invoice Number field to a unique index that ignores 
nulls.  Add a field to the Invoice ProcessFlag (Yes/No) default it to 
No.  Have her use that to select the ones to process and limit the list to 
those not processed.  In the "Process Button," add code that will loop 
through all those selected for processing and get an invoice number from 
the table you created.  As you get the invoice number, delete it from the 
list of available invoice numbers.

Robert

At 09:59 AM 2/24/2004 -0600, you wrote:
>Date: Tue, 24 Feb 2004 09:58:41 -0600
>From: "Gina Hoopes" <hoopesg at hotmail.com>
>Subject: [AccessD] Add records with sequential numbers
>To: AccessD at databaseadvisors.com
>Message-ID: <Sea1-F908fNp0VatC6Z0000138f at hotmail.com>
>Content-Type: text/plain; format=flowed
>
>I've got an invoicing database that the end user has used to create invoices
>on an individual basis.  Each time she clicks the "new invoice" button, I've
>coded the form to give her the next number in sequence.  She has a specific
>range of numbers she's required to use, so it can't just be an Auto Number.
>Anyway, it's been working great, but now they want to automate the process
>so that the db automatically generates all invoices for the month after I've
>presented her with a screen to check or uncheck those that should be
>created.  So, what I need help with doing is taking the temp table which
>contains those items she's checked, appending them to the Invoices table,
>and assigning them numbers in sequence.  If this was a straight auto number
>situation it would be easy, but I can't figure out how to get it to work
>using her numbering system.  The invoice number field is a text field
>because it contains non-numeric characters, but I've been able to get it to
>behave as a number for the individual creation purpose I described above by
>stripping the alpha characters, adding 1, then putting the alpha characters
>back in.  Can someone give me an idea of how to use an append query, or
>something similar, that will allow me to automate this process?
>
>Thanks,
>Gina





More information about the AccessD mailing list