Query to return unique results

christakis

Registered User.
Local time
Today, 20:06
Joined
Oct 23, 2009
Messages
72
Hi guys,

I have a table called,
tblC1:
ID [Autonumber]
Type [Text, Lookup from Value List]
etc

each record has a type. So I would have Type 1, Type 2, Type 3 apprearing several times.

In my "search" form I want to have a combo-box which will lookup what types are available and display.

I built a query for the row source of the combo box. This is,
SELECT tblC1.ID, tblC1.Type FROM tblC1 WHERE (((tblC1.Type) Is Not Null));

This gets all "Types" and ignores nulls but returns duplicate values. I tried using SELECT DISTINCT but it still returns duplicate values as tblC1.ID is distinct in all cases.

I tried SELECT tblC1.Type FROM tblC1 WHERE (((tblC1.Type) Is Not Null)); but the combobox doesnt show any results (Actually is has options to select from but they have no text).

Am I missing something obvious here? Is there another better way of doing this?

Thanks,
Christakis
 
if you just want the types, why are you using the ID?

The reason your combo after edit has no (visible) results is probably because the first column is hidden. Look at the properties of your combobox and in particular how many columns it displays and what the Column widths are.
 
if you just want the types, why are you using the ID?

The reason your combo after edit has no (visible) results is probably because the first column is hidden. Look at the properties of your combobox and in particular how many columns it displays and what the Column widths are.

Hi,

Thank you for your reply.

Here's what I tried,
SELECT tblC1.Type FROM tblC1 WHERE (((tblC1.Type) Is Not Null));
Column Count: 1
Bound Column: 1

The combo-box doesnt return any values for these settings. I created the form in design view, as soon as I put a combo-box in the wizard pops up. I select ONLY Type from tblC1 but it automatically puts in the ID too. The only way to remove the ID is to write my own Row Source but then again, it doesnt work.

Am I missing anything else?

Christakis

PS, I uploaded the properties of the box if you wanna have a look.
 

Attachments

  • cboType.JPG
    cboType.JPG
    84.8 KB · Views: 152
But what does "Column widths" say?? that is 0;2.5 ??

Your first (and only) column is (still) invisible!
 
But what does "Column widths" say?? that is 0;2.5 ??

Your first (and only) column is (still) invisible!

Oh my god... Am I blind or what? I just fixed it and it works fine. Thank you very much. I really appreciate it.

Christakis
 
Oh my god... Am I blind or what?
Not blind just stupid !

j/k offcourse

These little things where you have to change 10 different things to get 1 thing done usually you end up forgetting one...
 
Not blind just stupid !

j/k offcourse

These little things where you have to change 10 different things to get 1 thing done usually you end up forgetting one...

Yup I totally agree. The difference though, is now I know what I am looking for when things don't work.
 

Users who are viewing this thread

Back
Top Bottom