I have a feeling I haven't explained enough so let me expand here:
I have a form which I use to create invoices and a subform within that
which lists items to go on that invoice. I have created a 'button' on
the form which will send the open invoice record to areportand print
thereportjust for that invoice, including items on that invoice. The
original problem was that the items on the invoice were randomly
ordered. After the first replies to my question I realised that I had
an autonumber set up in the "Items" table and by including a
visible=no text box in the "Detail" section of thereport, there would
be something to sort by (i.e. theorderin which items are added).
However, when I sorted by this field, the printedreportput each item
in the open invoice on a separate page. This is what I am trying to
resolve. Forgive me if I haven't understood your answer but it seemed
like I hadn't explained myself properly. I do not need to sort by
customer or anything else as only one invoice is sent to print. It is
just that I am getting a separate invoice for each item!
Thanks again - I look forward to your reply!
Paul
Thank you both - I'm sure I'm getting there. However when I used the
sorting and grouping dialogue I ended up with each item on a different
page with its own header and footer. I figured I should set the "Group
Header" and "Group Footer" to 'No' but received a warning that I was
going to delete something and got all nervous! Is there a way to sort
but not to group? There will be a different number of items on each
invoice so imagine I don't want to set a fixed 'Interval'.
Thanks in advance!
On Sun, 26 Aug 2007 11:06:08 -0700, paulkaye wrote:
Is there any way to control theorderin which items appear on a
report(in this case, an invoice). The "details" section repeats for
each item but it does not necessarily appear in the sameorderas I
enter in the form. In fact, it is often the oppositeorder. The items
only have a name and a price; no naturalorderas far as I can think.
Thanks in advance for your patience with a noobie!
You'll have to add a [TimeEntered] field (DateTime datatype) to the
table.
Set it's DefaultValue property to = Now()
As you enter each value in the form the time of the entry will be
saved to the table along with your entry.
Then use this field in theReport'sSorting and Grouping dialog to
sort by. The entries will be printed in theorderentered.
If you just wish to sort the records according to the Time field, you
set the sort to the time field and leave Group Header and Footer set
to No.
However as this is for Invoices, you do want the Invoices sorted first
according to the CustomerID field (you don't want customer Jones's
items to be printed along with customer Smith's). So, as the first
sort, enter the CustomerID. Set it's Group Header to Yes. The Group
Footer can be Yes or No, depending upon your situation.
As the next sort, enter the Time field. Set it's Group Header and
Footer to No.
Next, set the CustomerID Header's ForceNewPage property (it's on the
Group's property sheet's Format tab) to BeforeSection.
Each Customer's Invoice will start on a new page. The detail will
print in theorderthe items were entered.