Connecting Tech Pros Worldwide Forums | Help | Site Map

Is there OpenArgs for Report?

swingingming
Guest
 
Posts: n/a
#1: Nov 13 '05
I want to print invoices. One Original and one copy, but I don't want
to keep 2 reports. I have 2 texboxes, How can I enable one in the first
copy and then enable (make visible) the second?
Thanks a lot.
ming


Allen Browne
Guest
 
Posts: n/a
#2: Nov 13 '05

re: Is there OpenArgs for Report?


So you want to print 2 copies of the invoice--one marked 'Original', and the
other 'Copy'?

1. Create a table with 2 fields:
CountID Number
CountName Text
Save it with the name tblCount.

2. Enter 2 records like this:
CountID CountName
1 Original
2 Copy

3. Create a query, containing this table and your original one. Make sure
there is no line joining the 2 tables in the upper pane of the query design
window, and drag all the fields you need into the output grid. Save the
query.

4. Open your report in design view. Set its RecordSource to the query. Open
the Sorting And Grouping dialog (View menu). On the first row dialog, choose
CountID, and in the lower pane of the dialog answer Yes for Group Header.

5. In the new group header section, add the CountName text box.

The report prints 2 copies of each record (because of the Cartesian product
query), with the appropriate heading on each one.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"swingingming" <ming.mge@gmail.com> wrote in message
news:1123571112.755372.296760@g44g2000cwa.googlegr oups.com...[color=blue]
>I want to print invoices. One Original and one copy, but I don't want
> to keep 2 reports. I have 2 texboxes, How can I enable one in the first
> copy and then enable (make visible) the second?
> Thanks a lot.
> ming[/color]


Trevor Best
Guest
 
Posts: n/a
#3: Nov 13 '05

re: Is there OpenArgs for Report?


swingingming wrote:[color=blue]
> I want to print invoices. One Original and one copy, but I don't want
> to keep 2 reports. I have 2 texboxes, How can I enable one in the first
> copy and then enable (make visible) the second?
> Thanks a lot.
> ming
>[/color]

The way I would do it (assuming a title like "Customer Copy" or "Office
Copy") would be on the form that opens the report, have a textbox there
then...

Me!MyTextBox.Value="Customer Copy"
DoCmd.OpenReport "rptInvoice"
Me!MyTextBox.Value="Office Copy"
DoCmd.OpenReport "rptInvoice"

Then the report would have a title textbox bound to
"=forms!MyDataEntryForm!MyTextBox"
Steve Jorgensen
Guest
 
Posts: n/a
#4: Nov 13 '05

re: Is there OpenArgs for Report?


On 9 Aug 2005 00:05:12 -0700, "swingingming" <ming.mge@gmail.com> wrote:
[color=blue]
>I want to print invoices. One Original and one copy, but I don't want
>to keep 2 reports. I have 2 texboxes, How can I enable one in the first
>copy and then enable (make visible) the second?
>Thanks a lot.
>ming[/color]

In Access 2002 and 2003, there's an OpenArgs parameter for OpenReport. In
2000 and earlier, there is not.
swingingming
Guest
 
Posts: n/a
#5: Nov 13 '05

re: Is there OpenArgs for Report?


Innovative solutions! Thank you guys. I learned a lot here!

David W. Fenton
Guest
 
Posts: n/a
#6: Nov 13 '05

re: Is there OpenArgs for Report?


"Allen Browne" <AllenBrowne@SeeSig.Invalid> wrote in
news:42f858fa$0$32260$5a62ac22@per-qv1-newsreader-01.iinet.net.au:
[color=blue]
> So you want to print 2 copies of the invoice--one marked
> 'Original', and the other 'Copy'?
>
> 1. Create a table with 2 fields:
> CountID Number
> CountName Text
> Save it with the name tblCount.
>
> 2. Enter 2 records like this:
> CountID CountName
> 1 Original
> 2 Copy
>
> 3. Create a query, containing this table and your original one.
> Make sure there is no line joining the 2 tables in the upper pane
> of the query design window, and drag all the fields you need into
> the output grid. Save the query.
>
> 4. Open your report in design view. Set its RecordSource to the
> query. Open the Sorting And Grouping dialog (View menu). On the
> first row dialog, choose CountID, and in the lower pane of the
> dialog answer Yes for Group Header.
>
> 5. In the new group header section, add the CountName text box.
>
> The report prints 2 copies of each record (because of the
> Cartesian product query), with the appropriate heading on each
> one.[/color]

Clever. And if you wanted only one copy, you could add the condition
CountID=1, or to print *just* the copy, CountID=2.

--
David W. Fenton http://www.bway.net/~dfenton
dfenton at bway dot net http://www.bway.net/~dfassoc
swingingming
Guest
 
Posts: n/a
#7: Nov 13 '05

re: Is there OpenArgs for Report?


Allen, I tried your method. And it works fine. Just that my second
report has a lot of sorting/grouping, so, it takes some time to get
them all correct. But it's a way of learning. Also, this reply is
better than the one on your webpage.
Thanks, ming

Closed Thread


Similar Microsoft Access / VBA bytes