|
From: Francis Cunningham, Jr. on 30 Jun 2008 16:13 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
From: pietlinden on 30 Jun 2008 17:58 On Jun 30, 3:13 pm, Francis Cunningham, Jr. <FrancisCunningha...(a)discussions.microsoft.com> 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).
|
Pages: 1 Prev: Sum values of column Next: display top 5 records for each subcategory |