invoice number on a report

G

Guest

I need to create an invoice report that has an auto-populated invoice # on
the first page of each group of data, where each first page has the next
sequential invoice number. And I need it to use the next sequential #, each
time the report is ran - is this possible???


Thank you.
 
A

Allen Browne

It is possible to store the highest number used so far in a table, use
DLookup() to read the value in the Report Header section, and add a text box
to the Detail (or Invoice header?) section and give it these properties:
Control Source =1
Running Sum Over All
Format General Number
Name txtCount
Visible No

Then add another text box that sums the two values:
=[txtLastUsed] + [txtCount]

I could not recommend that approach though. People pay on invoice numbers,
and your database is not storing them. Later you will have no way to trace
what Invoice 54 was, who it was to, which items it contains, or even when it
was printed. If a user filters or sorts the records differently in the
report, the database is not reliable, not ot mention the problem of keeping
the stored value up to date.

In general, you need a routine that creates and stores the invoices as a
batch, so the numbers are meaningful and you can refer to any invoice or
print it again later.
 
G

Guest

Thanks Allen! That's exactly what I needed to know. :)

Allen Browne said:
It is possible to store the highest number used so far in a table, use
DLookup() to read the value in the Report Header section, and add a text box
to the Detail (or Invoice header?) section and give it these properties:
Control Source =1
Running Sum Over All
Format General Number
Name txtCount
Visible No

Then add another text box that sums the two values:
=[txtLastUsed] + [txtCount]

I could not recommend that approach though. People pay on invoice numbers,
and your database is not storing them. Later you will have no way to trace
what Invoice 54 was, who it was to, which items it contains, or even when it
was printed. If a user filters or sorts the records differently in the
report, the database is not reliable, not ot mention the problem of keeping
the stored value up to date.

In general, you need a routine that creates and stores the invoices as a
batch, so the numbers are meaningful and you can refer to any invoice or
print it again later.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

afg said:
I need to create an invoice report that has an auto-populated invoice # on
the first page of each group of data, where each first page has the next
sequential invoice number. And I need it to use the next sequential #,
each
time the report is ran - is this possible???


Thank you.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top