0

Hi,

Create table myTable(
title ENUM ('Mr', 'Mrs', 'Miss') NOT NULL DEFAULT 'Mr'
);

How can i load ('Mr', 'Mrs', 'Miss') into a combobox in VB6.

Thanks

3
Contributors
6
Replies
7
Views
9 Years
Discussion Span
Last Post by veledrom
0

I know your solution but, I have to bring ENUM ('Mr', 'Mrs', 'Miss') from table.

0

Hi,

You mean, you want both Enum and ComboBox to be filled with data from the database table...?

Regards
Veena

0

Hi,

I have a comboBox in my Form1. When Form1.Load then, comboBox must have those ENUM values from that Table. Because, some people always add new values. They don't tell me to add it in my VB6 code.

Thanks

0

Hi,

If you are using VB6, open the recordset to the table, loop thru and populate the combo box, Check this :

Dim RST As New ADODB.RecordSet
Combo1.Clear
RST.Open "Select Distinct Title From MyTable",Conn
If Not RST.EOF  Then
    RST.MoveFirst
   Do While Not RST.EOF
       Combo1.AddItem RST(0) & ""
       RST.MoveNext
   Loop
End If

Regards
Veena

0

Hi,

I doesn't list all the values. Jumps on some values. Example; 1,2,3,4,5 this is listed as 1,3,5 or doesn't list one or two of them

Thanks

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.