If select ALL then show me all values?

A

ant1983

Hi,

i have a table suptblLevel with the following values:

autLevelID txtLevel
1 ALL
2 OPS
3 CON
4 LEAD

Then i have a form frmEmailScheduleToClientMenu where i have an unbound
combo box looking up above.

I select one of the values above and then have a cmdPreview button opening
qryTrainingDateForClientsWithCriteria showing the results.

I basically want, if i click ALL, to select OPS, CON and LEAD (Its not an
actual value in my query - How do i do that?)

the field in the query would be numLevel.

Ta

ant1983
 
A

Allen Browne

In query design view, try setting up the WHERE clause like this:

WHERE IIf([Forms].[frmEmailScheduleToClientMenu].[Combo1] = 1, (True),
[autLevelID] = [Forms].[frmEmailScheduleToClientMenu].[Combo1])

If the combo reads "ALL", the expression returns True regardless of what's
in the field. Otherwise the expression is true only if the field matches the
combo.

(I've assumed the combo's Column Count is 2, and the first column is
zero-width.)
 
A

ant1983

:)

Hmmm.... Where would i find that WHERE clause? LOL

Sorry :)

Allen Browne said:
In query design view, try setting up the WHERE clause like this:

WHERE IIf([Forms].[frmEmailScheduleToClientMenu].[Combo1] = 1, (True),
[autLevelID] = [Forms].[frmEmailScheduleToClientMenu].[Combo1])

If the combo reads "ALL", the expression returns True regardless of what's
in the field. Otherwise the expression is true only if the field matches the
combo.

(I've assumed the combo's Column Count is 2, and the first column is
zero-width.)

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.


ant1983 said:
Hi,

i have a table suptblLevel with the following values:

autLevelID txtLevel
1 ALL
2 OPS
3 CON
4 LEAD

Then i have a form frmEmailScheduleToClientMenu where i have an unbound
combo box looking up above.

I select one of the values above and then have a cmdPreview button opening
qryTrainingDateForClientsWithCriteria showing the results.

I basically want, if i click ALL, to select OPS, CON and LEAD (Its not an
actual value in my query - How do i do that?)

the field in the query would be numLevel.

Ta

ant1983
.
 
A

ant1983

Oh that worked great! Thanks!

ant1983 said:
:)

Hmmm.... Where would i find that WHERE clause? LOL

Sorry :)

Allen Browne said:
In query design view, try setting up the WHERE clause like this:

WHERE IIf([Forms].[frmEmailScheduleToClientMenu].[Combo1] = 1, (True),
[autLevelID] = [Forms].[frmEmailScheduleToClientMenu].[Combo1])

If the combo reads "ALL", the expression returns True regardless of what's
in the field. Otherwise the expression is true only if the field matches the
combo.

(I've assumed the combo's Column Count is 2, and the first column is
zero-width.)

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.


ant1983 said:
Hi,

i have a table suptblLevel with the following values:

autLevelID txtLevel
1 ALL
2 OPS
3 CON
4 LEAD

Then i have a form frmEmailScheduleToClientMenu where i have an unbound
combo box looking up above.

I select one of the values above and then have a cmdPreview button opening
qryTrainingDateForClientsWithCriteria showing the results.

I basically want, if i click ALL, to select OPS, CON and LEAD (Its not an
actual value in my query - How do i do that?)

the field in the query would be numLevel.

Ta

ant1983
.
 

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