Re: Query by form



Adding the word "DISTINCT" to the SQL in the Row Source under
Properties for the combo boxes did not seem to make a difference. Am I
doing it wrong?



pietlinden@xxxxxxxxxxx wrote:
Tom wrote:
Hello,

I have a database of employee data in access and I am trying to create
a form with combo boxes for criteria (ex. gender, office, position,
etc.) that let the user select criteria from drop down menus (ex. they
may select Male, New York, Manager) and those criteria will be used to
run a query (ie Query by Form). I can do this with text boxes but when
I tried to use combo boxes no records were returned in the query. Any
idea what I am doing wrong?

Sounds like either you have a multi-column combobox and you're not
filtering on the column you think you are. Although how that would
happen in a true filter by form, I'm not sure.


Also, is there an easy way to remove duplicates from the combo boxes?

Change the SQL.

SELECT Position
FROM tblEmployees...

to

SELECT DISTINCT Position....

.



Relevant Pages

  • RE: Filtering a subform using many combo boxes
    ... SELECT AssignedPriority, AssignedPriorityDetail FROM tblAssignedPriority ... YES for all of the combo boxes.) ... I followed you instructions to the letter and every one of the criteria ... open the query "qryProjects" in design view. ...
    (microsoft.public.access.forms)
  • RE: Filtering a subform using many combo boxes
    ... I followed you instructions to the letter and every one of the criteria ... I described the typical properties of all my combo boxes in my original ... open the query "qryProjects" in design view. ... I have a main table named tblProjectData that contains all the data for each ...
    (microsoft.public.access.forms)
  • Re: Passing query parameter from form
    ... I built the code that specifies the "WHERE" criteria for the form filter, ... This becomes quite messy where you have lots of text boxes, ... criteria from the query, and build a filter string instead. ... The form has two text boxes: one for the Special Event, ...
    (microsoft.public.access.forms)
  • Re: Help With Problems Creating Listboxes In A Form
    ... I would like to use List boxes if possible - Meaning, ... criteria for all 4 categories or maybe just 2. ... I would like 4 listboxes that all have input into the query. ...
    (microsoft.public.access.forms)
  • Re: Passing query parameter from form
    ... You can have the query read the values from the text boxes on the form. ... This becomes quite messy where you have lots of text boxes, and some may be left blank. ... to handle that kind of situation, it may be better to omit the criteria from the query, and build a filter string instead. ... Salaries and Other Costs (again using Special Event and Department as search ...
    (microsoft.public.access.forms)