Dialog Box To Answer Parameter Query

G

Guest

I was successful at following Micheal Green's Tip on Dialog Boxes to select
parameters for queries (www.fontstuff.com/access/index.htm) I am stuck on an
extra issue.

Where in my first criteria I have a simple number that answers the query for
a field, which is selected from the first combo box pointing to a table with
a column for the unique number and a column for the description.

The second field requires either/or criteria expressions which I have laid
out in a three column table....[descriptor].......[either this
expression]........[or this expression].

How do I break this up so that choosing the descriptor from the combo box
deposits the either/or expressions in the Query Criteria correctly? Am I
making any sense? Thank you.
 
G

Guest

Hi, Jeff.

Somehow you've got to allow the user to choose which expression is to be
used. One way is to populate the combo box with a row for each choice with a
Union query:

(Select fld1, fld2 from Table Order By fld1, fld2) UNION
(Select fld1, fld3 from Table Order By fld1, fld3)

Another way is to provide a second textbox and an option group of 2 buttons
to select the first expression or the second. Set the the values of the
option group to 1 and 2 respectively, and the ControlSource of the 2nd
textbox to something like:

= IIf([OptionGroup]=2, ComboBox.Column(2), ComboBox.Column(1))

which makes the first expression the default. Then refer to this second
textbox in your query.

If I've missed what you're after, please post some additional detail. An
example always helps.

Sprinks
 
G

Guest

Below is the Criteria for my first parameter:
[Forms]![frmReportMenu]![cboDirectors]

cboDirectors points to tblDirectorsList

Column 1 Column2
Dir_ID……….......Name

Dir_ID is the parameter called for in the query
I select OK on the dialog box and get my report in preview mode

I want to also select a specific report in the second combobox which I can
do with a single parameter like above but I have an either/or situation

I am looking for [Forms]![frmReportMenu]![cboReports]
Where cboReports points to tblReports

Column1 Column2 Column3
rptName EITHER expression OR expression

I appreciate the insight.

Sprinks said:
Hi, Jeff.

Somehow you've got to allow the user to choose which expression is to be
used. One way is to populate the combo box with a row for each choice with a
Union query:

(Select fld1, fld2 from Table Order By fld1, fld2) UNION
(Select fld1, fld3 from Table Order By fld1, fld3)

Another way is to provide a second textbox and an option group of 2 buttons
to select the first expression or the second. Set the the values of the
option group to 1 and 2 respectively, and the ControlSource of the 2nd
textbox to something like:

= IIf([OptionGroup]=2, ComboBox.Column(2), ComboBox.Column(1))

which makes the first expression the default. Then refer to this second
textbox in your query.

If I've missed what you're after, please post some additional detail. An
example always helps.

Sprinks

Jeff C said:
I was successful at following Micheal Green's Tip on Dialog Boxes to select
parameters for queries (www.fontstuff.com/access/index.htm) I am stuck on an
extra issue.

Where in my first criteria I have a simple number that answers the query for
a field, which is selected from the first combo box pointing to a table with
a column for the unique number and a column for the description.

The second field requires either/or criteria expressions which I have laid
out in a three column table....[descriptor].......[either this
expression]........[or this expression].

How do I break this up so that choosing the descriptor from the combo box
deposits the either/or expressions in the Query Criteria correctly? Am I
making any sense? Thank you.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top