Hi Simon,
I tried your suggestion using the code below:
Private Sub fillCombo(cbobox As SSDBCombo, ByVal sTable As String, ByVal sField As String)
Dim db As Database
rs As Recordset
Set db = Workspaces(0).OpenDatabase(MyDbPath, False, False, "; pwd=data"
Set rs = db.OpenRecordset("select distinct" & sField & " from " & sTable & " order by " & _
sField, dbOpenSnapshot)
While Not rs.EOF
cbobox.AddItem rs(sField)
rs.MoveNext
Wend
rs.Close
Set db = Nothing
End Sub
Private Sub cmdopen_Click()
Call fillCombo(SSDBCombo2, "Fields", "Name"
End Sub
When I click the OPEN button, I get a type mismatch error
I double checked everthing and as far as I can see, Everything is declared properly. Do you see any any reason why I would get this error message?
Thanks,
Cooleen
[sig][/sig]