repeating data

  • Thread starter Thread starter Angelina
  • Start date Start date
A

Angelina

Hi,

I have used the dataAdapater wizard to create a query that
pulls all rows from a table. so that they can be displayed
in a combobox. The only prob is, i am gettiing repeating
rows in the combobox.
does anyone know how i can get rid of these. i tried to
use distinct at the start of the query, but i doesnt seem
to accept this.
 
if the rows are completely the same Select Distinct should work.
if there is a difference in 1 field it wont work.

hope it helps
 
There is a difference in the field.
the table contains caravan details. each row looks like
the following

Cara_Name cara_length cost
Delux 11 50
Delux 15 85
budget 8 20
budget 10 22

in my query i want to pull only the caravan name so they
can be displayed in a combobox for the user to select.
The length is then shown accordingly in another combobox
based on the caravan name slected by tyhe user.

Is there any way of achieveing this?

any help would be appreciated
 
select distinct Cara_Name from tblCara order by cara_name

should do the trick

after you have selected a caravan for the 2nd cbo you will get

select distinct cara_length from tblCara where Cara_Name = '" & cboName.text
& "' Order by cara_length"
note the ' " & string & " ' quotes

eric
 
Back
Top