dbTalk Databases Forums  

Parameter Query

comp.database.ms-access comp.database.ms-access


Discuss Parameter Query in the comp.database.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Jon
 
Posts: n/a

Default Parameter Query - 01-22-2004 , 05:43 PM






I currently run a parameter query on the following 3
fields: Position, Date, Value. Each field has the
parameter details in the criteria

I therefore have 3 sets of prompts coming up. Is this the
best way to run a query that asks for variables? or is
there a better method.

The position fields have admin, sales, clerk and Manager.
I would like if possible for the Position field to ask for
any number of variables (ie clerk, admin, sales or
Manager, sales etc)

I feel my method is somewhat laborious for the end user.

Any suggestions would be appreciated?

Reply With Quote
  #2  
Old   
Bruce Pick
 
Posts: n/a

Default Re: Parameter Query - 01-22-2004 , 11:16 PM






Comsidering your question, I thought at first that a user might be able
to specify multiple criteria in the criteria input box as long as the
proper syntax was used. However, this did not work out when I tried it,
even though you could specify that in design view. As: using
#1/1/2004# Or #1/2/2004# would give records having either of those dates.

You can build what you've proposed using a form with VBA code. It could
enable the user to specify nearly any combination of multiple criteria.
However, to build it, you need to be able to write SQL queries, or at
least create them in the query design view and then copy the SQL code
and understand how it's put together. You also need to be able to write
VBA code that will create valid workable SQL based on whatever input the
user has entered on the form. I think the details of the solution are
beyond the scope of this newsgroup unless you already are able to do
most of this. If so, I or we can probably help you fill in the gaps.

Bruce Pick

Jon wrote:
Quote:
I currently run a parameter query on the following 3
fields: Position, Date, Value. Each field has the
parameter details in the criteria

I therefore have 3 sets of prompts coming up. Is this the
best way to run a query that asks for variables? or is
there a better method.

The position fields have admin, sales, clerk and Manager.
I would like if possible for the Position field to ask for
any number of variables (ie clerk, admin, sales or
Manager, sales etc)

I feel my method is somewhat laborious for the end user.

Any suggestions would be appreciated?

Reply With Quote
  #3  
Old   
Bruce Pick
 
Posts: n/a

Default Re: Parameter Query - 01-23-2004 , 06:02 AM



I mis-spoke. Access includes a pretty good tool for user filtering of
queries and tables.

With the query open in normal display, click Records - Filter - Filter
By Form. You get to specify one value for any of the fields shown. The
tabs at lower left allow you to set additional acceptable criteria.

When using this, any fields that have an index established in design
view seem to have a drop-down list of available values, on the Filter By
Form grid. Without an index, user can still type in any value, but can
specify values that don't exist in the table and so will get no records
for that set of criteria.

Bruce Pick

Jon wrote:
Quote:
I currently run a parameter query on the following 3
fields: Position, Date, Value. Each field has the
parameter details in the criteria

I therefore have 3 sets of prompts coming up. Is this the
best way to run a query that asks for variables? or is
there a better method.

The position fields have admin, sales, clerk and Manager.
I would like if possible for the Position field to ask for
any number of variables (ie clerk, admin, sales or
Manager, sales etc)

I feel my method is somewhat laborious for the end user.

Any suggestions would be appreciated?

Reply With Quote
Reply




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 On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.