473,406 Members | 2,336 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

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

Nov 13 '05 #1
6 2699
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" <mi******@gmail.com> wrote in message
news:11**********************@g44g2000cwa.googlegr oups.com...
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

Nov 13 '05 #2
swingingming wrote:
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


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"
Nov 13 '05 #3
On 9 Aug 2005 00:05:12 -0700, "swingingming" <mi******@gmail.com> wrote:
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


In Access 2002 and 2003, there's an OpenArgs parameter for OpenReport. In
2000 and earlier, there is not.
Nov 13 '05 #4
Innovative solutions! Thank you guys. I learned a lot here!

Nov 13 '05 #5
"Allen Browne" <Al*********@SeeSig.Invalid> wrote in
news:42***********************@per-qv1-newsreader-01.iinet.net.au:
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.


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
Nov 13 '05 #6
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

Nov 13 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: nic | last post by:
Hi am having difficulty understanding why the following is not working. Dim TempID As Integer Set TempID = Me.OpenArgs Knowing that OpenArgs is a string I then changed the declaration of...
11
by: Susan Bricker | last post by:
Hi. I am trying to open a form using 'openargs' parameter of the docmd.openform action. The problem is that I would like to pass the form some character (string) and integer data. My plan was to...
3
by: Tim Marshall | last post by:
I am almost certain that when I opened a form in A97 that openargs was available in that form's class module for the whole time the form was open. Apparantly this is not the case in A2003. From...
4
by: Barry Edmund Wright | last post by:
Hi All, I am using the code below to assign a form name to a form variable (vFrm). Is there a way to assign the Openargs string directly to vFrm, i.e. vFrm = Openargs ? Private Sub...
2
by: shumaker | last post by:
I think the problem lies in my understanding(or misunderstanding) of the scope of references. 'Code from button click event on first form: Private Sub Ok_Click() Dim strRecordSource As String...
1
by: Neil | last post by:
Hello: I am using an Access 2003 project as a front-end to a SQL Server 2000 database. When I am calling a report, I use this line in the VBA code: DoCmd.OpenReport...
3
by: Tanis | last post by:
How do you pass more than one argument using OpenArgs?
3
by: dou | last post by:
In searching for a solution to a current problem I ran across a thread from 2005 on the same issue, ( http://www.thescripts.com/forum/thread202473.html ). In that case it appeared that the problem...
3
by: angi35 | last post by:
I'm having a zero-length string problem... Hoping someone can help. (This is in Access 2000.) In FormA, I have a button that opens FormB with OpenArgs. In FormB, the OpenArgs are translated into...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.