Select form and reports from a combobox

D

dazred

How do go about selecting forms and reports from a combobox. I wish to use a
command button that opens a form selected from its combobox. The reports
button and combobox work similarly with additonal controls to print the
report(check box) and text boxes that filter the report by date range
 
K

Klatuu

1. Make your row source in your combo box a value list of the forms or
reports you want to open.
2. In the Click event of the command button to open a form or report, insert
the code to open the form or report based on the vaule in the combo box:

DoCmd.OpenForm Me.MyComboBoxName
 
D

dazred

Hi
I'm having problems....
In the properties of the combobox I select rowsourcetype as Value list but
the rowsourse does not have the any selection of reports. It has only my
selection of tables and queries and it only allows one table/query to be
selected .
Do i need to create a table of Reports?
I also need help with the additional controls used when the reports are
selected. I need to choose to open the report in print preview or just print
it using check boxes and a set of date textboxes which can be used to filter
a report by a date range
 
K

Klatuu

You can either create a table with the names of the reports and use the table
as the row source or you can type in the names of the reports seperated by a
semicolon (;)
You will want to use the name of the report, not the table of query the
report uses. That should be identified by the report.

If you want to give the option to open the report in either print or
preview, I would suggest two command buttons, one for each choice.

To filter the reports by date range, then text boxes to enter the dates
would be a good idea. Then you will need to use the Where Condition clause
of the OpenReport method to do the filtering.
 
Top