Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PRINT DIFFERENT REPORTS USING SELECTION IN FORM 1

Status
Not open for further replies.

desikan

Technical User
Feb 2, 2001
105
AE
Hi,
I have a form with a combo box having values -- "under warranty" and "out of warranty".

I want to have a command button running a macro to print "Report1" and Report2" if "under warranty" is chosen and if "out of warranty" is chosen then the macro should run "Report1","Report2","Report3" and "Report4".

I can of course have 2 separate command buttons running separate macros but I prefer a more dynamic method ?

Any help will be appreciated.

Thanks

R.Desikan



 
I can't help you with a macro but the code would be:

If Me.cboWarranty = true Then
DoCmd.OpenReport "Report1"
DoCmd.OpenReport "Report2"
Else
DoCmd.OpenReport "Report1"
DoCmd.OpenReport "Report2"
DoCmd.OpenReport "Report3"
DoCmd.OpenReport "Report4"
End if

Frank J Hill
FHS Services Ltd.
frank@fhsservices.co.uk
 
Thanks for the reply.

I tried the code but it does not work and the program stops at this line "If Me.cboWarranty = true ".

I am not familiar with code.
Can you please clarify little more about the exact wording to be used ??

R.Desikan
 
Hi,
I just replaced the 1st line of the code as--

If Me.cboWarranty = "out of warranty" and then every thing worked out fine.

Thanks a lot for the help

R.Desikan

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top