If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
combo box select distinct doesn't work duplicates occur
On Mon, 24 Jul 2006 03:27:34 GMT, "newdatabaser via AccessMonster.com"
u24131@uwe wrote: Combo box properties you asked for are as follows: Row source type= Table/Query Row source= SELECT DISTINCT [GRI Projects].ID, [GRI Projects].Location_ FROM [GRI Projects] ORDER BY Location; Control source: none (it's unbound) Name: Location I'd like the combo box to show: East West If I select East and hit OK I display in another form all records that have East as the Location. In that form users can edit records. The search works ok. Above I only show 4 records there are many more. The drop down might show 20 Easts and 30 Wests. Users have to scroll a lot to find the Location they want. thanks again Well... if you don't want your combo box to contain the ID, don't include the ID in the query. Chante the Row Source to SELECT DISTINCT [GRI PRojects].[Location] FROM [GRI Projects] ORDER BY Location]; Change the Column Count to 1, and the Bound Column should also be 1. Obviously if the combo box is unbound, the EAST or WEST that you select will not be stored anywhere and (unless you have VBA code somewhere to do so) nothing will be done with it. I presume that you have such code in the OK button's click event. John W. Vinson[MVP] |
#2
|
|||
|
|||
combo box select distinct doesn't work duplicates occur
Right. I missed the ID being called out in the row source. I used the
wizard to great it. I changed the Row Source code, column count and bound column as you suggested and the . Now there is nothing in the drop down list of the combo box. There are plenty of records that have text in the Location field. Any other suggestions? Yes I use the OK button to search the GRI table for records. John Vinson wrote: Well... if you don't want your combo box to contain the ID, don't include the ID in the query. Chante the Row Source to SELECT DISTINCT [GRI PRojects].[Location] FROM [GRI Projects] ORDER BY Location]; Change the Column Count to 1, and the Bound Column should also be 1. Obviously if the combo box is unbound, the EAST or WEST that you select will not be stored anywhere and (unless you have VBA code somewhere to do so) nothing will be done with it. I presume that you have such code in the OK button's click event. John W. Vinson[MVP] -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...forms/200607/1 |
Thread Tools | |
Display Modes | |
|
|