A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

combo box select distinct doesn't work duplicates occur



 
 
Thread Tools Display Modes
  #1  
Old July 24th, 2006, 08:54 PM posted to microsoft.public.access.forms
John Vinson
external usenet poster
 
Posts: 4,033
Default 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  
Old July 25th, 2006, 01:02 AM posted to microsoft.public.access.forms
newdatabaser via AccessMonster.com
external usenet poster
 
Posts: 2
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 08:28 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.