A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

One Command Button for different reports



 
 
Thread Tools Display Modes
  #1  
Old June 30th, 2008, 09:13 PM posted to microsoft.public.access.queries
Francis Cunningham, Jr.
external usenet poster
 
Posts: 37
Default 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  
Old June 30th, 2008, 10:58 PM posted to microsoft.public.access.queries
[email protected]
external usenet poster
 
Posts: 744
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 10:15 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.