Re: Requery Combo Box

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Thanks Ken, I tried that and the results were an empty box.
The SQL was generated like you said, but produced no results.

"Ken Sheridan" <KenSheridan@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:447E7B26-4E54-4749-93BE-7FE3DF1ABEE6@xxxxxxxxxxxxxxxx
You'll need to repeat the column name in the criterion for the second
combo
box:

<>Forms!frmApprovalList!ComboBox1 AND [Designator]
<>Forms!frmApprovalList!ComboBox2

You can do it in SQL view or all in one column as a single entry in the
criteria row in query design view, or you can add the Designator column to
the design grid twice, unchecking the 'show' check box for the second
instance. On the same criteria row for each column add the restrictions
separately in each, i.e. <>Forms!frmApprovalList!ComboBox1 for one and
<>Forms!frmApprovalList!ComboBox2 for the other. Access will then insert
the
AND operator in the SQL statement for you.

Ken Sheridan
Stafford, England

"Chuck" wrote:

Not sure if I am doing this correctly or not. I have a form that has
several combo boxes on it that allow a user to pick a name from a list.
I
need to have the next combo box be requeried and not include the
selection
from the first box. This has to continue until four boxes have been
selected.

The table, tblDesignators, have the data that is in the combo box. For
an
example, it contains the names of people.

The user selects a name from the first combo box that has a query behind
it
to select all the names. After the selection, the user moves onto the
next
box and selects a new name. I don't want the name from the first
selection
to appear in the box. I almost had it by using a query that had
something
like this in the criteria of the query:

<>Forms!frmApprovalList!ComboBox1.

This did work for the second combo box.

The third combo box I tried the criteria as

<>Forms!frmApprovalList!ComboBox1 AND <>Forms!frmApprovalList!ComboBox2.

The selection ended up with no records. I tried an OR as well and still
no
results.

If someone decides to go back and change names, the first box has to be
requeried and start again.

Make sense?






.



Relevant Pages

  • RE: Designing Query - Help Please ASAP
    ... Once I copied the before mentioned langauge in my SQL view, ... query, ... SELECT [tblProject Staffing Resources].ProjectID, [tblProject Staffing ... If I make a selection in the ProjectID box = then the subform will ...
    (microsoft.public.access.queries)
  • Re: Pass field value selected in Combo Box to SQL Query
    ... you would refer to the control in the query. ... The form must be open when the query executes. ... If this does not work for you, then you need to post the SQL of your queries so we can see what is happening. ... row selected in the combo box to be used as the selection criteria in a SQL ...
    (microsoft.public.access.gettingstarted)
  • 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: Pass field value selected in Combo Box to SQL Query
    ... And where would you use/display the results of this select query? ... using a combo box on your form to select filter criteria; ... box, and display all records, if there is no selection. ... My form displays a combo box populated by a SQL SELECT statement. ...
    (microsoft.public.access.gettingstarted)
  • Re: query involving dates
    ... so you have a query that is not giving the desired results. ... Open it in SQL View ... In the Field row of the output grid, ... >> field from Table_1 into the grid, and in the Criteria row enter: ...
    (microsoft.public.access.queries)