Having trouble creating a query..............

T

Tony

Could please help in simple terms on how to create a query that will give me
the ability to run on query on data alreading in a field.

I have one table that captures shipping info. I would like to do a query
that has a drop down list of the entries of a field. this way I will
eliminate people spelling entries wrong and getting nothing from the query.

I am beginner so be kind........
 
T

Tom Wickerath

Hi Tony,

If the field data repeats in many records, then you'd likely be better off
to create a new "lookup" table, with a one-to-many (1:M) relationship to your
existing table. This way, the row source for your combo box can be based on a
smaller table. But, for the present time, let's assume that you have just the
one shipping table, and you'd like to present a unique list of values in a
combo box. To accomplish this goal, you can use a query that includes the
DISTINCT keyword as the row source for the combo box.

Find the sample Northwind.mdb database that is likely already present on
your hard drive. Copy it to your working folder, so that you leave the
original copy untouched. Try the following query on the Customers table, to
present a unique list of cities:

SELECT DISTINCT City
FROM Customers
ORDER BY City;

To use the above SQL (Structured Query Language) statement, create a new
query. Dismiss the Add Tables dialog without adding any tables. Click on View
| SQL View (if you are using Access 2007, there is likely a ribbon equivalent
to this command). You should see the word SELECT highlighted. Delete this key
word. Copy the above SQL statement, and paste it into the SQL View. Run the
query. You can now switch back to the more familiar design view if you wish.


Tom Wickerath
Microsoft Access MVP
http://www.accessmvp.com/TWickerath/
http://www.access.qbuilt.com/html/expert_contributors.html
__________________________________________
 
G

Guest

Tony said:
Could please help in simple terms on how to create a query that will give
me
the ability to run on query on data alreading in a field.

I have one table that captures shipping info. I would like to do a query
that has a drop down list of the entries of a field. this way I will
eliminate people spelling entries wrong and getting nothing from the
query.

I am beginner so be kind........
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top