Parameter From Combo Box

  • Thread starter Thread starter Bob Watson
  • Start date Start date
B

Bob Watson

I understand what this query will do relative to
parameters:

PARAMETERS [Begin Date] DateTime, [End Date] DateTime;
SELECT Nz(Registration.Age, "Blank") AS RegistrationAge,
Count(Registration.Age) AS RegistrationCount
FROM Registration
WHERE (((Registration.[Date Attended])<=[End Date]
And (Registration.[Date Attended])>=[Begin Date]))
GROUP BY Registration.Age;
________


What if I wanted a similar query with different
parameters ... different parameter format I mean ...
picked from a combo box ... say I wanted them where
a persons CountyOfOrigin was Lee, Chambers or Montgomery
picked from a "drop-down combo box". How do I go
about this? Also, if the combo box is left blank from
the picks of Lee/Chambers/Montgomery then it just
skips the WHERE part and provides all counties ??

TIA,
Bob
 
Bob:

Using form controls as criteria for a query is generally referred to as
Query By Form. The following KB article shows how to do this for textboxes.
The same can be done for a combo box.

http://support.microsoft.com/default.aspx?scid=kb;en-us;304428

--
David Lloyd
MCSD .NET
http://LemingtonConsulting.com

This response is supplied "as is" without any representations or warranties.



I understand what this query will do relative to
parameters:

PARAMETERS [Begin Date] DateTime, [End Date] DateTime;
SELECT Nz(Registration.Age, "Blank") AS RegistrationAge,
Count(Registration.Age) AS RegistrationCount
FROM Registration
WHERE (((Registration.[Date Attended])<=[End Date]
And (Registration.[Date Attended])>=[Begin Date]))
GROUP BY Registration.Age;
________


What if I wanted a similar query with different
parameters ... different parameter format I mean ...
picked from a combo box ... say I wanted them where
a persons CountyOfOrigin was Lee, Chambers or Montgomery
picked from a "drop-down combo box". How do I go
about this? Also, if the combo box is left blank from
the picks of Lee/Chambers/Montgomery then it just
skips the WHERE part and provides all counties ??

TIA,
Bob
 
Back
Top