View Full Version : Reports from Sub form criteria...


CEH
02-28-2005, 02:55 PM
I'm not sure where to post this..... But since it will probably require some coding... I'll try here.
I have a database that is a rating system.
One form is designed to print your reports in one of three ways.
I am using one form, with three subforms. One subform for each type of criteria. ei... (Date... Between and...) (Job#... Between ...And....) and (Inspection#.. Between...And) Three command buttons.. One to make each input box (subform) visible.
Now........ The problem is my Printing and Preview buttons.
I have these on the main form. How do I tell it which criteria to print or preview for?
For example... I would pick the "By Date" button... The subform would become visible and I enter the dates "From" and "To"...........
So........ How do I tell the "Preview" button to preview the "By Date" report.... basically so the Print or Preview goes to the correct criteria viewd in the subform..........
Make sense???

Bachatero
03-01-2005, 02:12 AM
two possible solutions at a glance:
instead of using three subforms use one and place a combobox to choose Date, Job or inspection

second:
add a public variable "LastCriteriaType" to the main form
when you click the command button set the variable to 1, 2 or 3 (or any
other constant)
when the print/preview button is pushed check LastCriteriaType


I'm not sure where to post this..... But since it will probably require some coding... I'll try here.
I have a database that is a rating system.
One form is designed to print your reports in one of three ways.
I am using one form, with three subforms. One subform for each type of criteria. ei... (Date... Between and...) (Job#... Between ...And....) and (Inspection#.. Between...And) Three command buttons.. One to make each input box (subform) visible.
Now........ The problem is my Printing and Preview buttons.
I have these on the main form. How do I tell it which criteria to print or preview for?
For example... I would pick the "By Date" button... The subform would become visible and I enter the dates "From" and "To"...........
So........ How do I tell the "Preview" button to preview the "By Date" report.... basically so the Print or Preview goes to the correct criteria viewd in the subform..........
Make sense???