If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
One Command Button for different reports
I am not sure if I am in the right Discussion Group, so here it is...
I have five different queries called ‘Cooling, Electric, Gas, Heat Pump and Oil’ I would like to create a one command button on a form called ‘Contract’, that based on two fields on this form, called ‘ContractNumber’ and ‘ContractType’ will generate the specific report. The ContractNumber is unique (primary key, required and no duplicates allowed) to the form ‘Contract’. So based on the ContractNumber and the ContractType on the query I would like the result to be the correct query or report for the record. Can someone help? Frank |
#2
|
|||
|
|||
One Command Button for different reports
On Jun 30, 3:13*pm, Francis Cunningham, Jr.
wrote: I am not sure if I am in the right Discussion Group, so here it is... I have five different queries called ‘Cooling, Electric, Gas, Heat Pump and Oil’ I would like to create a one command button on a form called ‘Contract’, that based on two fields on this form, called ‘ContractNumber’ and ‘ContractType’ will generate the specific report. The ContractNumber is unique (primary key, required and no duplicates allowed) to the form ‘Contract’. So based on the ContractNumber and the ContractType on the query I would like the result to be the correct query or report for the record. Can someone help? Frank Create the unfiltered report as usual. Then create a button on your form to open the report for only the active record. One of the arguments for the OpenReport command is a filter, which is just a valid WHERE clause without the "Where" keyword. Albert Kallal has a nice example on his website. IF you want, create a macro that does it, then convert it to VBA (right-click, save as Module). |
Thread Tools | |
Display Modes | |
|
|