query and a drop down form

G

Guest

I needed a drop down box for my query to find my branch and rep name for some
orders. I found the posting for the "Customizing Access Parameter Queries"
This was great, my problem that I am having is when I drop down my list it is
huge with the same branch name. I used a table with columns Branchname,
Repname, OrderId, Empname, Hours, Payrate, etc. each time an order is
created it will add the branch name and rep name . I was hoping there was a
way to have the drop down show 1 record for each branch and rep name.

Thanks in advance for any information you can help me with.
 
J

John Spencer

You need to use a query instead of a tablename so the query only returns the
BranchName and the RepName and use the DISTINCT predicate in the query.

-- Open your form in design mode
-- Click on the combobox
-- Select Viow: Properties from the menu
-- In the properties dialog, click on the data tab
-- Click on the three dots at the end of the Row Source property
-- Answer Yes to the dialog "Do you want to create a query based on the
table"
-- Select the Branchname and Repname fields
-- Sort by the two fields Ascending
-- Set the query property Unique Values to Yes (Double click in the grey
area next to the table)
-- Close and save

You may have to adjust the column count and other properties of the
combobox.
 

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