D darryle Jan 30, 2004 #1 I would like to fill a combo box with table names. Can someone give me a hint? Thanks!
O OriginalStealth Jan 31, 2004 #2 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
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
T TC Jan 31, 2004 #3 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
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