Re: Query by form



In the design view of the recruiting survey for the gender control
combo box, my SQL code is:

SELECT DISTINCT RecruitingSurvey.ID, RecruitingSurvey.Gender FROM
RecruitingSurvey ORDER BY [Gender];

The code for the rest of the drop downs is parallel in structure...



fredg wrote:
On 29 Jun 2006 12:21:03 -0700, Tom wrote:

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

How can anyone tell? You haven't posted your actual SQL.
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail

.



Relevant Pages

  • Re: Using combo box selection to supply criteria for query
    ... Sorry, I am still learning SQL and VBA, I don't think that I made the ... The form contains 5 combo boxes; SBT Account, Region, ADM, Month, Year ... If I only make a selection in the Region combo box ... Post the query SQL. ...
    (microsoft.public.access.forms)
  • Re: ACCELERATING STORE PROCEDURE
    ... original raw data is inserted with bcp utility, ... (possible Cartesian join) ... Steps 5 - 17 might be replaced with a SQL statement something like ... One of the rules of efficient programs is to use just SQL code (no PL/ ...
    (comp.databases.oracle.server)
  • RE: passing data to new form using open args
    ... If the SQL you are trying to send to the form is the data you want for your ... As to the SQL you have for your combo boxes. ... Row Source type to Table/Query and put the SQL in the Row Source property. ...
    (microsoft.public.access.formscoding)
  • Re: QUERY - AND/OR for search panel
    ... Here is the SQL that got the job done. ... FOR an AND Query between five boxes: ... An easier solution would be to build the WHERE clause ...
    (microsoft.public.access.queries)
  • Re: Macro for running text in Memo fields as SQL
    ... and check boxes create a SQL string, then have some VBA code that reads ... Macro for running text in Memo fields as SQL ... I have a form with various unbound tick boxes & combo boxes. ...
    (microsoft.public.access.macros)