Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Combo Box
Message
 
To
07/11/2002 04:50:00
General information
Forum:
Visual Basic
Category:
Other
Title:
Miscellaneous
Thread ID:
00719714
Message ID:
00719821
Views:
16
>Hi,
>
>I got a little question, when try to assign the following code to the button, which use to clean up the combo box and store the data which come from table : deptmast.
>
>But I got a error something like : "Method and Data Member Cannot Be Found"
>
> Combo1.Clear
> rs.Open "select dept_name from deptmast order by dept_name", status.cn
> rs.MoveFirst
> Do While Not rs.EOF
> Combo1.AddItem rs!dept_name
> rs.MoveNext
> Loop
>
>
>Really Thanks for your help
>Aston

Aston;

Here is the code I use.
' Create and a simple recordset…
    
    Dim rst As ADODB.Recordset
    Set rst = New ADODB.Recordset

 ' Open recordset 
  
    rst.ActiveConnection = _
    "Provider=Microsoft.Jet.OLEDB.3.51; " & _
    "Data Source=" & App.Path & "\..\nWind.MDB"
     

    rst.Source =  "SELECT distinct city  FROM Customers Order By City"
    rst.Open

' Fill a combo box...

Do Until rst.EOF
    cboCity.AddItem rst!city
    rst.MoveNext
Loop

rst.Close
Tom
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform