Check box in subform for printing

dakcg

Registered User.
Local time
Today, 18:53
Joined
Aug 24, 2001
Messages
88
Hi all, I have a database used for quotes. I have a quote form that has a subform for quote details. In that subform you choose the products and qty. On the same line, I also have a checkbox set up for "options" . This is a product that shows up seperate from the products on the quote.

I have set up two reports, one without options and the other with options, then I set up a code in the print button on the form that prints one report if "options=yes" another when "options=no". That works, but only if the focus is left on the option button! I have tryed to force the focus back to the options button, but that didn't work. I also tried to use a hidden checkbox that will update to yes if options were picked, then use that hidden checkbox, but that didn't work either.

Any Suggestions are Greatly Apprecaited

DAK
 
Just to be sure: Your print command button is on the Main Form while the check box is on the subform?

If so, perhaps something like this put in the click event of the command button will work for you:

If [Forms]![MainFormName]![SubFormName]![ChkBoxName] _
= True Then

DoCmd.Openreport "ThisOne", acViewnormal

Else

DoCmd.OpenReport "ThatOne", acViewnormal

End if

A key item to check: the name property of your subform.

Regards,
Tim
 
Thanks Tim,

You are right about the button being on the main form and the options check box of the subform. I will try your idea. Thanks again!
DAK
 

Users who are viewing this thread

Back
Top Bottom