A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

print different report based on value in control



 
 
Thread Tools Display Modes
  #1  
Old August 6th, 2007, 04:12 PM posted to microsoft.public.access.reports
J
external usenet poster
 
Posts: 293
Default print different report based on value in control

I have a form for data entry and I want to add a command button that will
print a one of 2 reports for the current record. What determines the report
is the value in the field FrameQty. If the value is 6 then I want to print
Traveler6, if the value is 4 then I want to print Traveler4. Help is
appreciated.
  #2  
Old August 6th, 2007, 05:09 PM posted to microsoft.public.access.reports
fredg
external usenet poster
 
Posts: 4,386
Default print different report based on value in control

On Mon, 6 Aug 2007 08:12:05 -0700, J wrote:

I have a form for data entry and I want to add a command button that will
print a one of 2 reports for the current record. What determines the report
is the value in the field FrameQty. If the value is 6 then I want to print
Traveler6, if the value is 4 then I want to print Traveler4. Help is
appreciated.


Code the command button's click event:

If Me.FrameQty = 4 or Me.FrameQty = 6 then
DoCmd.OpenReport "Traveler" & Me.FrameQty
End If

--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
  #3  
Old August 7th, 2007, 10:40 PM posted to microsoft.public.access.reports
George Nicholson
external usenet poster
 
Posts: 791
Default print different report based on value in control


I would use a Select Case statement because its easiest to change when (not
if) you add reports/options in the futu

Select Case FrameQty
Case 4
DoCmd.OpenReport "Traveler4"
Case 6
DoCmd.OpenReport "Traveler6"
Case Else
MsgBox "Unexpected Value"
End Select



"J" wrote in message
...
I have a form for data entry and I want to add a command button that will
print a one of 2 reports for the current record. What determines the
report
is the value in the field FrameQty. If the value is 6 then I want to print
Traveler6, if the value is 4 then I want to print Traveler4. Help is
appreciated.



 




Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 07:33 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.