Select a value from list in Query

  • Thread starter Thread starter rrh
  • Start date Start date
R

rrh

I want to have a query that will show the combobox value
and let the person select a value to than run the query.

Ex:
combobox has list of 5 Building names.

I want the person to see the list and select one (so that
the query will than run) to get the rest of the
information about the buidling.

I do not wan to show like the names are all to close in
spelling.
 
Your last sentence doesn't make sense.

A query will normally show a parameter box, not a combo.
Make a datasheet style form to hold the results of your search.
Now make a blank form and put your combo on that. I presume that your
Buildings are listed in a table called Buildings which has a Primary Key
field (I'll call it BuildID) and the Building name, add both to the combo
but shrink/hide the Primary Key field so only the building name will be
seen.

In the AfterUpdate event of the Combo use
DoCmd.OpenForm "The Name of Your Form",acFormDS,,"[BuildID]=" & Me.the name
of your new combo.
Evi
 
Dear RR:

Put the combo box on a form, probably the one which will have a
command button to open the query. Simply reference the value of the
combo box from the query (assuming you are writing an MDB).

About "names that are all too close in spelling" - you should not
allow the users to simply spell these names different ways. Instead,
make a table of them from which the user then chooses one in related
tables. By creating a relationship to this table, you can reduce the
creation of multiple spellings of the "same" name.

However, the final judgment of "too close in spelling" is a human one.
Only by showing the users a combo box list of names and asking them to
choose one, and having them confirm when they choose to add a new
name, can you get any control over this situation.

Anyway, when there really are 2 names that are spelled similarly,
there has to be a choice to allow both of them in the list.

As this list appears to have only 5 items in it at the current time,
it would seem that the need to add new items should be fairly rare.
So having a table of these names and using a combo box as the bound
control to select them should do a nice job of preventing multiple
spellings of a single name.

Tom Ellison
Microsoft Access MVP
Ellison Enterprises - Your One Stop IT Experts
 
Back
Top