by magscy (Philippines) (3 Submissions)
Category: Databases/Data Access/DAO/ADO
Compatability: Visual Basic 5.0
Difficulty: Unknown Difficulty
Originally Published: Sun 9th June 2002
Date Added: Mon 8th February 2021
Rating: (1 Votes)
Fill ComboBox with data from database.
API Declarations
' paste the code.
'Open the Database
Set DB = DBEngine.Workspaces(0).OpenDatabase(App.Path & "\your database.mdb")
'Open table
Set RS = DB.OpenRecordset("your table here")
cboAnyName.Clear
While Not RS.EOF
cboAnyName.AddItem RS!AnyField
If RS.EOF Then
GoTo Exitna
End If
RS.MoveNext
Wend
Exitna:
RS.Close ' close table
Set RS = Nothing
End Sub