Hello,
I wrote the following code in one of the programs:
Whenever I tried to run it, the program kept saying:
Item not found in this collection, and the value of the counter is set to 14 although I only have 10 tables, with the first one containing Inf in the name.
Could anyone please help? Thanks!
I wrote the following code in one of the programs:
Code:
'first, define necessary variables
Dim db As Database
Dim tableCounter As Integer
Dim newtablename As String
newtablename = "AppendAllFields"
Set db = CurrentDb
Dim counter As Integer
counter = 1
'loop around for tables
Do While InStr(1, Left(db.TableDefs(counter).Name, 3), "Inf") = 0
Item not found in this collection, and the value of the counter is set to 14 although I only have 10 tables, with the first one containing Inf in the name.
Could anyone please help? Thanks!