You just need to get the number of fields each time and then do your calculations. Maybe this snippet of code I use can be helpful or give you some ideas. It loops through all fields in a table and loads their names into a combobox (lstTables.Text is the name of the table I'm examaning):
For Each Table In jetDB.TableDefs
If Table.Name Like lstTables.Text Then
For Each field In jetDB.TableDefs(TabNdx%).Fields
lstFields.AddItem field.Name
For i% = 0 To 2
cboSort(i%).AddItem field.Name
cboSrch(i%).AddItem field.Name
Next i%
Next field
End If
TabNdx% = TabNdx% + 1
Next Table