If select ALL then show me all values?

  • Thread starter Thread starter ant1983
  • Start date Start date
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
 
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.)
 
:)

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
.
 
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
.
 
Back
Top