Fill Combo Box With File Names

  • Thread starter Thread starter darryle
  • Start date Start date
First Set your combo box format properties to the
following:

column count: 2
column widths: 0";1"

Next add this to your form's OnLoad Property.


Private Sub Form_Load()

'Declare variables
Dim db As Database
Dim tdf As TableDef

Set db = CurrentDb()

'Fill with Tables
For Each tdf In CurrentDb.TableDefs
Me.cbo1.AddItem "TABLE;" & tdf.Name
Next

End Sub
 
Depends on version of Access.

For A2k?+, use the AddItem method (as per other respondent).

For A97 & before, check online help for the RowSourceType property - getting
listbox values from a function.

HTH,
TC
 
Back
Top