Connecting Tech Pros Worldwide Help | Site Map

Is there OpenArgs for Report?

 
LinkBack Thread Tools Search this Thread
  #1  
Old November 13th, 2005, 12:42 PM
swingingming
Guest
 
Posts: n/a
Default Is there OpenArgs for Report?

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


  #2  
Old November 13th, 2005, 12:42 PM
Allen Browne
Guest
 
Posts: n/a
Default 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]


  #3  
Old November 13th, 2005, 12:42 PM
Trevor Best
Guest
 
Posts: n/a
Default 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"
  #4  
Old November 13th, 2005, 12:42 PM
Steve Jorgensen
Guest
 
Posts: n/a
Default 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.
  #5  
Old November 13th, 2005, 12:42 PM
swingingming
Guest
 
Posts: n/a
Default Re: Is there OpenArgs for Report?

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

  #6  
Old November 13th, 2005, 12:43 PM
David W. Fenton
Guest
 
Posts: n/a
Default 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
  #7  
Old November 13th, 2005, 12:47 PM
swingingming
Guest
 
Posts: n/a
Default 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

 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,662 network members.