A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

invoice number



 
 
Thread Tools Display Modes
  #21  
Old June 10th, 2009, 06:15 PM posted to microsoft.public.access.tablesdbdesign
cjgav
external usenet poster
 
Posts: 54
Default invoice number

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.

  #22  
Old June 10th, 2009, 07:01 PM posted to microsoft.public.access.tablesdbdesign
Steve[_72_]
external usenet poster
 
Posts: 190
Default invoice number

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.



  #23  
Old June 10th, 2009, 08:24 PM posted to microsoft.public.access.tablesdbdesign
cjgav
external usenet poster
 
Posts: 54
Default invoice number

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.




  #24  
Old June 10th, 2009, 08:32 PM posted to microsoft.public.access.tablesdbdesign
cjgav
external usenet poster
 
Posts: 54
Default invoice number

Hi,
That reference was already checked .
I've checked the table name and all the field names and I still receive a
syntax error in this line:
rst.Open "select inrLastUsed from tblInvoiceNumbers where inrType = """ & _
strType & """ and inrYear = " & Year(Date), cnn, adOpenKeyset,
Regards

"Noëlla Gabriël" wrote:

Hi,

the reference is called:
Microsoft ActiveX Data Objects x.x library

if that's installed and you still get errors, check the tablenames and
fieldnames in the expression. They should match the existing table in your
database.
--
Kind regards
Noëlla


"cjgav" wrote:

Hi
I've tried to do this but there is no ADODB LIBARY listed !

"Noëlla Gabriël" wrote:

Hi,

You need to have a reference to the ADODB library in your project. Open a
module (any module) , click tools - references and check the ADODB reference
lib. I don't have my own computer now, so can't have a quick look now, but
you'll find it :-)
--
Kind regards
Noëlla


"cjgav" wrote:


Hi
Thank you for your help this looks very much like it.
I do not understand vb very well at all do i need to edit function as it
stands there seems to be a compile error on line rst.open


  #25  
Old June 10th, 2009, 09:38 PM posted to microsoft.public.access.tablesdbdesign
Steve[_72_]
external usenet poster
 
Posts: 190
Default invoice number

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.






  #26  
Old June 10th, 2009, 10:45 PM posted to microsoft.public.access.tablesdbdesign
cjgav
external usenet poster
 
Posts: 54
Default invoice number

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.






  #27  
Old June 10th, 2009, 10:47 PM posted to microsoft.public.access.tablesdbdesign
cjgav
external usenet poster
 
Posts: 54
Default invoice number

sorry table Invoice

"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.






  #28  
Old June 11th, 2009, 09:47 AM posted to microsoft.public.access.tablesdbdesign
Noëlla Gabriël
external usenet poster
 
Posts: 79
Default invoice number

Hi,

don't forget the last argument adLockPessimistic after the ",". In fact the
whole statement "rst.open" till "adLockPessimistic" is one statement. The
"_ " sign makes it possible to continue on the next line. The last argument
probably is put on a next line by the text editor of the newsgroup, but
should continue on the same line.
Tip: while typing the code, in a lot of cases, the VBA editor shows the
possible arguments.

--
Kind regards
Noëlla


"cjgav" wrote:

Hi,
That reference was already checked .
I've checked the table name and all the field names and I still receive a
syntax error in this line:
rst.Open "select inrLastUsed from tblInvoiceNumbers where inrType = """ & _
strType & """ and inrYear = " & Year(Date), cnn, adOpenKeyset,
Regards


  #29  
Old June 11th, 2009, 04:17 PM posted to microsoft.public.access.tablesdbdesign
Steve[_72_]
external usenet poster
 
Posts: 190
Default invoice number

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.








  #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.









 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 11:03 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.