Array help please

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm trying to do a loop to modify tables ending in the name serial_range_t;
there will probably be tables added periodically in the future for growth but
the constant is the table name of serial_range_t. I've already got the code
finished to update the tables one at a time by the user inputting the table
name but now I want to get away from the user having to input the table name
for the linked ODBC table. I'm trying to play around with setting up an
array but I'm having problems getting this part going. How can I set up an
array to list the linked tables in the Access database with the linked table
names ending in "*.serial_range_t"?? Any help would be extremely appreciated.
 
I'm trying to do a loop to modify tables ending in the name serial_range_t;
there will probably be tables added periodically in the future for growth but
the constant is the table name of serial_range_t. I've already got the code
finished to update the tables one at a time by the user inputting the table
name but now I want to get away from the user having to input the table name
for the linked ODBC table. I'm trying to play around with setting up an
array but I'm having problems getting this part going. How can I set up an
array to list the linked tables in the Access database with the linked table
names ending in "*.serial_range_t"?? Any help would be extremely appreciated.

Where are these tables? You're aware (I presume) that storing data in
tablenames is monstrously complicated (as you're finding) and usually
not necessary?

There is a Tabledefs collection in the Database object: you can loop
through it like

Dim db As DAO.Database
Dim tdf As DAO.Tabledef
Dim vTableNames() As String
Dim iPos As Integer
iPos = 0
Set db = CurrentDb
For Each tdf In db.Tabledefs
If Right(tdf.Name, 13) = "serial_range_t") Then
vTableNames(iPos) = tdf.Name
iPos = iPos + 1
End If
Next tdf


John W. Vinson[MVP]
Join the online Access Chats
Tuesday 11am EDT - Thursday 3:30pm EDT
http://community.compuserve.com/msdevapps
 
Back
Top