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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Option Group or Combo Box to filter a Report

Status
Not open for further replies.

MrPiccolo

Technical User
Mar 29, 2004
15
GB
Hi,
I have a form which has two option groups, and a command button;

form: Report1
-------------
OptionGroup1 OptionGroup2
[] Report_name1 [] PreView (current) Report
[] Report_name2 [] Print (current) Report

{Commandbutton}

The user selects report1 or report2 and then chooses to view (or) print the selected report.
The command button executes the desired choices.

So far this works ok, but I need to use a parameter filter in Report_name1 (or underlying) query to filter report_name1 to show only the required [filtered] fields.
The question is; would it be best to use a combo-box or another option-group to filter the underlying query before the command button is activated? And where is the combo-box or option group best placed? (I.e. embedded in the report or on the report1 form or in the query)?
NB the field to be filtered is an id_field based on a lookup table below;

lookup_table: Xray_site_tbl
---------------------------
field1: Auto-id (#1, #2, #3)
field2: Anatomy_group_Desc (E.g. Head, Chest, Leg)
Any suggestions welcome!
MrP
 
I'm still looking at this and thinking, but for starters, why not just use 2 command buttons:

cmdPreview

and

cmdPrint

That is the most common practice anywhere I've seen anything. The reason is it'd be simpler to handle, and it would run more efficiently - not that it'd be complex code to differentiate, but it just seems to make more sense and be more "user friendly" to boot.

You could even go so far as to the point of this sort of form layout if you wanted... thus doing away with some of the headache/confusion of conditional statements in comparison with strait basic code:

[tt]
-----------------------------------------------------
Report_name1 | Report_name2
|
{cmdPreviewName1} | {cmdPreviewName2}
{cmdPrintName1} | {cmdPrintName2}
-----------------------------------------------------
[/tt]

Either that or:

[tt]
-----------------------------------------------------
Choose Your Report!

[] Report_name1
[] Report_name2

{cmdPreview} {cmdPrint}
-----------------------------------------------------
[/tt]

--

"If to err is human, then I must be some kind of human!" -Me
 
How is the report recordsource built? And what is the difference between Report1 and Report2?

The reason I'm asking is that you could possibly have just one report, and then change the record source on the fly as needed - if there are no format differences and such.

--

"If to err is human, then I must be some kind of human!" -Me
 
Hi,
The reason I've gone with the 'option group' layout is that these 2 reports are just the beginning; it's very likely that there may be 10 - 12 different reports (all producing different output from diffrent query sources); this layout allows me to have a 'neat' list of reports on the left hand side of the form. However as the user's report requirements grow I may well hve to think of another alternative..!
MrP
 
I'd use a ComboBox for the report choice as some hidden columns may store specific infos useable in code without a bunch of If ... ElseIf ...

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top