Forms passing parameters

G

Guest

I am using a form to pass parameters to my query.

My query is set criteria is
Like [Forms]![Form1]![Typesort]

My field has 3 valid values.

How can I use my form to pass the parameters and have the query pull two of
the three or in other words show all but one ?

Thanks
 
G

Guest

This works, however it creates another situation, I still need to be able to
select one and show just that one.

KARL DEWEY said:
If you want to show all but one then use --
Not Like [Forms]![Form1]![Typesort]

MM said:
I am using a form to pass parameters to my query.

My query is set criteria is
Like [Forms]![Form1]![Typesort]

My field has 3 valid values.

How can I use my form to pass the parameters and have the query pull two of
the three or in other words show all but one ?

Thanks
 
T

Tom Ellison

Dear MM:

What kind of value are you having the user thpe into the Typesort control?
What are the 3 valid values?

There are many possibilities:

1. You could have Typesort be a Combo Box and choose the one value to
exclude.

2. You could have Typesort be a List Box with multi-select, and choose the
one, two, or three values to include.

3. Typesort could be a text box, and the user types the whole value in
there.

It is not even slightly clear why you are using LIKE. Are the users typing
in wildcard values or what?

I recommend against the text box approach. The list box would seem to be
the best user interface, perhaps with all 3 values initially selected, so
that a single click on the one value to exclude is all that is needed.

Tom Ellison
 
G

Guest

I am using a combobox with the following values

*
A
B
C

I used "Like" so when the * was selected it would give me all A,B,C.

Tom Ellison said:
Dear MM:

What kind of value are you having the user thpe into the Typesort control?
What are the 3 valid values?

There are many possibilities:

1. You could have Typesort be a Combo Box and choose the one value to
exclude.

2. You could have Typesort be a List Box with multi-select, and choose the
one, two, or three values to include.

3. Typesort could be a text box, and the user types the whole value in
there.

It is not even slightly clear why you are using LIKE. Are the users typing
in wildcard values or what?

I recommend against the text box approach. The list box would seem to be
the best user interface, perhaps with all 3 values initially selected, so
that a single click on the one value to exclude is all that is needed.

Tom Ellison


MM said:
I am using a form to pass parameters to my query.

My query is set criteria is
Like [Forms]![Form1]![Typesort]

My field has 3 valid values.

How can I use my form to pass the parameters and have the query pull two
of
the three or in other words show all but one ?

Thanks
 
T

Tom Ellison

Dear MM:

You could have the combo box show:

All
AB
AC
BC
A
B
C

In the first, hidden column, put these:

[ABC]
[AB]
[AC]
[BC]
A
B
C

Use the first column in the query.

To hide a column in a combo box, make its width 0.

Tom Ellison


MM said:
I am using a combobox with the following values

*
A
B
C

I used "Like" so when the * was selected it would give me all A,B,C.

Tom Ellison said:
Dear MM:

What kind of value are you having the user thpe into the Typesort
control?
What are the 3 valid values?

There are many possibilities:

1. You could have Typesort be a Combo Box and choose the one value to
exclude.

2. You could have Typesort be a List Box with multi-select, and choose
the
one, two, or three values to include.

3. Typesort could be a text box, and the user types the whole value in
there.

It is not even slightly clear why you are using LIKE. Are the users
typing
in wildcard values or what?

I recommend against the text box approach. The list box would seem to be
the best user interface, perhaps with all 3 values initially selected, so
that a single click on the one value to exclude is all that is needed.

Tom Ellison


MM said:
I am using a form to pass parameters to my query.

My query is set criteria is
Like [Forms]![Form1]![Typesort]

My field has 3 valid values.

How can I use my form to pass the parameters and have the query pull
two
of
the three or in other words show all but one ?

Thanks
 
G

Guest

I must be doing something wrong.

I used your method and I get no results in my query for any of the combined
selections. It only works for the single selections.

Any ideas?

Tom Ellison said:
Dear MM:

You could have the combo box show:

All
AB
AC
BC
A
B
C

In the first, hidden column, put these:

[ABC]
[AB]
[AC]
[BC]
A
B
C

Use the first column in the query.

To hide a column in a combo box, make its width 0.

Tom Ellison


MM said:
I am using a combobox with the following values

*
A
B
C

I used "Like" so when the * was selected it would give me all A,B,C.

Tom Ellison said:
Dear MM:

What kind of value are you having the user thpe into the Typesort
control?
What are the 3 valid values?

There are many possibilities:

1. You could have Typesort be a Combo Box and choose the one value to
exclude.

2. You could have Typesort be a List Box with multi-select, and choose
the
one, two, or three values to include.

3. Typesort could be a text box, and the user types the whole value in
there.

It is not even slightly clear why you are using LIKE. Are the users
typing
in wildcard values or what?

I recommend against the text box approach. The list box would seem to be
the best user interface, perhaps with all 3 values initially selected, so
that a single click on the one value to exclude is all that is needed.

Tom Ellison


I am using a form to pass parameters to my query.

My query is set criteria is
Like [Forms]![Form1]![Typesort]

My field has 3 valid values.

How can I use my form to pass the parameters and have the query pull
two
of
the three or in other words show all but one ?

Thanks
 
T

Tom Ellison

Dear MM:

Please post the SQL View of your query.

Tom Ellison


MM said:
I must be doing something wrong.

I used your method and I get no results in my query for any of the
combined
selections. It only works for the single selections.

Any ideas?

Tom Ellison said:
Dear MM:

You could have the combo box show:

All
AB
AC
BC
A
B
C

In the first, hidden column, put these:

[ABC]
[AB]
[AC]
[BC]
A
B
C

Use the first column in the query.

To hide a column in a combo box, make its width 0.

Tom Ellison


MM said:
I am using a combobox with the following values

*
A
B
C

I used "Like" so when the * was selected it would give me all A,B,C.

:

Dear MM:

What kind of value are you having the user thpe into the Typesort
control?
What are the 3 valid values?

There are many possibilities:

1. You could have Typesort be a Combo Box and choose the one value to
exclude.

2. You could have Typesort be a List Box with multi-select, and
choose
the
one, two, or three values to include.

3. Typesort could be a text box, and the user types the whole value
in
there.

It is not even slightly clear why you are using LIKE. Are the users
typing
in wildcard values or what?

I recommend against the text box approach. The list box would seem to
be
the best user interface, perhaps with all 3 values initially selected,
so
that a single click on the one value to exclude is all that is needed.

Tom Ellison


I am using a form to pass parameters to my query.

My query is set criteria is
Like [Forms]![Form1]![Typesort]

My field has 3 valid values.

How can I use my form to pass the parameters and have the query pull
two
of
the three or in other words show all but one ?

Thanks
 
G

Guest

Tom

I got it to work using just one letter,.however my valid values are multiple
characters. I just used A,B,C to shorten it for posting, I thought the logic
would work on my "real values".

SELECT tbl_Gaps.Gap_ID, tbl_Gaps.GapDescription, tbl_Gaps.StartDate,
tbl_Gaps.EndDate, tbl_Gaps.Notes
FROM tbl_Gaps
WHERE (((tbl_Gaps.GapDescription) Like [Forms]![Form2]![Combo22]));



Tom Ellison said:
Dear MM:

Please post the SQL View of your query.

Tom Ellison


MM said:
I must be doing something wrong.

I used your method and I get no results in my query for any of the
combined
selections. It only works for the single selections.

Any ideas?

Tom Ellison said:
Dear MM:

You could have the combo box show:

All
AB
AC
BC
A
B
C

In the first, hidden column, put these:

[ABC]
[AB]
[AC]
[BC]
A
B
C

Use the first column in the query.

To hide a column in a combo box, make its width 0.

Tom Ellison


I am using a combobox with the following values

*
A
B
C

I used "Like" so when the * was selected it would give me all A,B,C.

:

Dear MM:

What kind of value are you having the user thpe into the Typesort
control?
What are the 3 valid values?

There are many possibilities:

1. You could have Typesort be a Combo Box and choose the one value to
exclude.

2. You could have Typesort be a List Box with multi-select, and
choose
the
one, two, or three values to include.

3. Typesort could be a text box, and the user types the whole value
in
there.

It is not even slightly clear why you are using LIKE. Are the users
typing
in wildcard values or what?

I recommend against the text box approach. The list box would seem to
be
the best user interface, perhaps with all 3 values initially selected,
so
that a single click on the one value to exclude is all that is needed.

Tom Ellison


I am using a form to pass parameters to my query.

My query is set criteria is
Like [Forms]![Form1]![Typesort]

My field has 3 valid values.

How can I use my form to pass the parameters and have the query pull
two
of
the three or in other words show all but one ?

Thanks
 
T

Tom Ellison

Dear MM:

Just for a test, could we temporarily change the query:

SELECT Gap_ID, GapDescription, StartDate, EndDate, Notes,
[Forms]![Form2]![Combo22]
FROM tbl_Gaps

Please choose AB in the combo box, then post a few rows of what this
produces.

Tom Ellison


MM said:
Tom

I got it to work using just one letter,.however my valid values are
multiple
characters. I just used A,B,C to shorten it for posting, I thought the
logic
would work on my "real values".

SELECT tbl_Gaps.Gap_ID, tbl_Gaps.GapDescription, tbl_Gaps.StartDate,
tbl_Gaps.EndDate, tbl_Gaps.Notes
FROM tbl_Gaps
WHERE (((tbl_Gaps.GapDescription) Like [Forms]![Form2]![Combo22]));



Tom Ellison said:
Dear MM:

Please post the SQL View of your query.

Tom Ellison


MM said:
I must be doing something wrong.

I used your method and I get no results in my query for any of the
combined
selections. It only works for the single selections.

Any ideas?

:

Dear MM:

You could have the combo box show:

All
AB
AC
BC
A
B
C

In the first, hidden column, put these:

[ABC]
[AB]
[AC]
[BC]
A
B
C

Use the first column in the query.

To hide a column in a combo box, make its width 0.

Tom Ellison


I am using a combobox with the following values

*
A
B
C

I used "Like" so when the * was selected it would give me all A,B,C.

:

Dear MM:

What kind of value are you having the user thpe into the Typesort
control?
What are the 3 valid values?

There are many possibilities:

1. You could have Typesort be a Combo Box and choose the one value
to
exclude.

2. You could have Typesort be a List Box with multi-select, and
choose
the
one, two, or three values to include.

3. Typesort could be a text box, and the user types the whole
value
in
there.

It is not even slightly clear why you are using LIKE. Are the
users
typing
in wildcard values or what?

I recommend against the text box approach. The list box would seem
to
be
the best user interface, perhaps with all 3 values initially
selected,
so
that a single click on the one value to exclude is all that is
needed.

Tom Ellison


I am using a form to pass parameters to my query.

My query is set criteria is
Like [Forms]![Form1]![Typesort]

My field has 3 valid values.

How can I use my form to pass the parameters and have the query
pull
two
of
the three or in other words show all but one ?

Thanks
 
G

Guest

Task ID Task Description Start Date End Date Notes Expr1
1 test [testrev]
2 rev [testrev]
3 check [testrev]
4 test [testrev]
5 rev [testrev]
6 test [testrev]

Tom Ellison said:
Dear MM:

Just for a test, could we temporarily change the query:

SELECT Gap_ID, GapDescription, StartDate, EndDate, Notes,
[Forms]![Form2]![Combo22]
FROM tbl_Gaps

Please choose AB in the combo box, then post a few rows of what this
produces.

Tom Ellison


MM said:
Tom

I got it to work using just one letter,.however my valid values are
multiple
characters. I just used A,B,C to shorten it for posting, I thought the
logic
would work on my "real values".

SELECT tbl_Gaps.Gap_ID, tbl_Gaps.GapDescription, tbl_Gaps.StartDate,
tbl_Gaps.EndDate, tbl_Gaps.Notes
FROM tbl_Gaps
WHERE (((tbl_Gaps.GapDescription) Like [Forms]![Form2]![Combo22]));



Tom Ellison said:
Dear MM:

Please post the SQL View of your query.

Tom Ellison


I must be doing something wrong.

I used your method and I get no results in my query for any of the
combined
selections. It only works for the single selections.

Any ideas?

:

Dear MM:

You could have the combo box show:

All
AB
AC
BC
A
B
C

In the first, hidden column, put these:

[ABC]
[AB]
[AC]
[BC]
A
B
C

Use the first column in the query.

To hide a column in a combo box, make its width 0.

Tom Ellison


I am using a combobox with the following values

*
A
B
C

I used "Like" so when the * was selected it would give me all A,B,C.

:

Dear MM:

What kind of value are you having the user thpe into the Typesort
control?
What are the 3 valid values?

There are many possibilities:

1. You could have Typesort be a Combo Box and choose the one value
to
exclude.

2. You could have Typesort be a List Box with multi-select, and
choose
the
one, two, or three values to include.

3. Typesort could be a text box, and the user types the whole
value
in
there.

It is not even slightly clear why you are using LIKE. Are the
users
typing
in wildcard values or what?

I recommend against the text box approach. The list box would seem
to
be
the best user interface, perhaps with all 3 values initially
selected,
so
that a single click on the one value to exclude is all that is
needed.

Tom Ellison


I am using a form to pass parameters to my query.

My query is set criteria is
Like [Forms]![Form1]![Typesort]

My field has 3 valid values.

How can I use my form to pass the parameters and have the query
pull
two
of
the three or in other words show all but one ?

Thanks
 
T

Tom Ellison

Dear MM:

The query has 6 columns, the results show 3. I take it that 1-6 is Task ID,
test or rev is Task Description and [testrev] is what is chosen in the combo
box.

Now, everything we have discussed so far had only 1 letter in each value for
Description. It turn out you have 3 or for character long values, including
"test" and "rev". The third value is "check". Is this now correct?

If these are not just one character long, like A, B, and C, then everything
we have discussed is worthless. This will work only for 1 character long
values.

The most direct solution will be to switch to a list box showing the 3
values and use multi select to choose the ones desired. You must then code
the generation of the SQL by reading through the selected values in the list
box to generate the query needed. These value will go into an IN() clause.
Build the IN() clause in code, stepping through the selected values.

In order to save time in the future, please do not "camoflage" your actual
problem when posting. The fact that these are not one character long values
has wasted your time and mine. It cannot be done as you started, with a
combo box, except by tedious and unnecessarily difficult steps that will not
finally be flexible if the list of values should ever change.

Tom Ellison


MM said:
Task ID Task Description Start Date End Date Notes Expr1
1 test [testrev]
2 rev [testrev]
3 check [testrev]
4 test [testrev]
5 rev [testrev]
6 test [testrev]

Tom Ellison said:
Dear MM:

Just for a test, could we temporarily change the query:

SELECT Gap_ID, GapDescription, StartDate, EndDate, Notes,
[Forms]![Form2]![Combo22]
FROM tbl_Gaps

Please choose AB in the combo box, then post a few rows of what this
produces.

Tom Ellison


MM said:
Tom

I got it to work using just one letter,.however my valid values are
multiple
characters. I just used A,B,C to shorten it for posting, I thought the
logic
would work on my "real values".

SELECT tbl_Gaps.Gap_ID, tbl_Gaps.GapDescription, tbl_Gaps.StartDate,
tbl_Gaps.EndDate, tbl_Gaps.Notes
FROM tbl_Gaps
WHERE (((tbl_Gaps.GapDescription) Like [Forms]![Form2]![Combo22]));



:

Dear MM:

Please post the SQL View of your query.

Tom Ellison


I must be doing something wrong.

I used your method and I get no results in my query for any of the
combined
selections. It only works for the single selections.

Any ideas?

:

Dear MM:

You could have the combo box show:

All
AB
AC
BC
A
B
C

In the first, hidden column, put these:

[ABC]
[AB]
[AC]
[BC]
A
B
C

Use the first column in the query.

To hide a column in a combo box, make its width 0.

Tom Ellison


I am using a combobox with the following values

*
A
B
C

I used "Like" so when the * was selected it would give me all
A,B,C.

:

Dear MM:

What kind of value are you having the user thpe into the
Typesort
control?
What are the 3 valid values?

There are many possibilities:

1. You could have Typesort be a Combo Box and choose the one
value
to
exclude.

2. You could have Typesort be a List Box with multi-select, and
choose
the
one, two, or three values to include.

3. Typesort could be a text box, and the user types the whole
value
in
there.

It is not even slightly clear why you are using LIKE. Are the
users
typing
in wildcard values or what?

I recommend against the text box approach. The list box would
seem
to
be
the best user interface, perhaps with all 3 values initially
selected,
so
that a single click on the one value to exclude is all that is
needed.

Tom Ellison


I am using a form to pass parameters to my query.

My query is set criteria is
Like [Forms]![Form1]![Typesort]

My field has 3 valid values.

How can I use my form to pass the parameters and have the
query
pull
two
of
the three or in other words show all but one ?

Thanks
 

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