Row Source Question

Huey462

Board Regular
Joined
Jul 25, 2011
Messages
147
I have a report that contains a dropdown menu to allow the user to filter out unwanted information. I have a list built with pre-determined values/positions. What I had hoped to do was change the SELECT from the default list to a list of values contained in the form’s table. So if there were only two shops on the report, the user wouldn’t have to pick from a list of 20, only the 2 would be displayed.</SPAN>

Original SOURCE:</SPAN>
SELECT [tblOffice].OfficeSymbol FROM tblOffice ORDER BY [tblOffice].OfficeSymbol;</SPAN>

This would result in a list of shops like the example below:</SPAN>
[Blank]</SPAN>
Shop A</SPAN>
Shop B</SPAN>
Shop C</SPAN>
and so on</SPAN>

Modified SOURCE:</SPAN>
SELECT [tblToDo].OPR FROM tblToDo ORDER BY [tblToDo].OPR;</SPAN>

This would result in a list of shops like the example below:</SPAN>
[Blank]</SPAN>
Shop A</SPAN>
Shop A</SPAN>
Shop B</SPAN>
Shop B</SPAN>
Shop B</SPAN>
and so on</SPAN>

My question is this: is it possible to remove duplicate listings of the same shop in the second version?</SPAN>
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
If it behaves like other SQL,
SELECT DISTINCT [tblToDo].OPR FROM tblToDo ORDER BY [tblToDo].OPR;
should work
 
Upvote 0
SELECT DISTINCT is valid syntax in Access, so it should work.
Alternatively, you could also do an Aggregate Query, where you Group the records, thus weeding out the duplicates.
 
Upvote 0

Forum statistics

Threads
1,215,139
Messages
6,123,262
Members
449,093
Latest member
Vincent Khandagale

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top