Thread: invoice number
View Single Post
  #30  
Old June 12th, 2009, 10:33 PM posted to microsoft.public.access.tablesdbdesign
cjgav
external usenet poster
 
Posts: 54
Default invoice number

Hi
I've tried to do this when I type in the formula I get compile error :
expected =, and the + highlighted.
I know I'm making this hard but can you please help

regards


"Steve" wrote:

Notice in the formula that the table name is TblInvoice. Your table name
"Invoices" does not match. You need to change one or the other so both are
the same.

You also put the formula in the wrong place. Read my previous response
again. Add another field named "InvoiceDate" to your table. Build a form
with two fields based on TblInvoice. Select the InvoiceDate field, open
properties, go to the event tab, go to the AfterUpdate event and create a
subroutine. Put the formula in the subroutine.

Steve


"cjgav" wrote in message
...
Hi Steve

I think i'm been a bit stupid here

To test this I've setup a table (invoices) with 1 field (Invoicenumber)
I've entered the formula DMax("[InvoiceNumber]","TblInvoice") + 1 in an
event procedure on a form when I run this event I get a syntax error.
What am I doing wrong?

regards

"Steve" wrote:

Look again at Fred's response. Just as he says, you don't want to create
the
invoice number in the print event. Look again at my response. I suggest
you
create the invoice number in the AfterUpdate event of the InvoiceDate
field.

Steve


"cjgav" wrote in message
...
Hi Steve
Thanks for that not sure were to put the Dmax formula so it updates the
invoice number when I print also this number would need to be stored in
the
invoice table and not change .

"Steve" wrote:

Did you read my suggestion above?

Steve



"cjgav" wrote in message
...
Hi
My problem is I donot know how to generate a number without using
autonum
which is unsuitable .

"Fred" wrote:

Under my described thought process, you would create the record in
the
invoice table and create an invoice number at the time that the
invoice
event
occurred. The first printing would happen a few seconds AFTER that
process.
And later you could print extra copies of that invoice if needed.