>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