I am pretty new to VBA . I have a table contains more than 30 fields. How do i store the column names into array using vba
My vba Code
Dim tdf As TableDef
Dim fld As Field
Dim o As Integer
Set tdf = db.TableDefs(tablename)
Dim n As Integer
n = tdf.Fields.Count
ReDim tablecolumns(0 To n) As String
For o = 0 To n
tablecolumns(n) = fld.Name(o)
Next o
Giving an error in this line
tablecolumns(n) = fld.Name(o)