R
Ronald R. Dodge, Jr.
OS: Windows XP, SP2
Access 2002, SP3
MDAC 2.8
DAO 3.60
Using DAO Coding
I have a code within a class module and the variable used for the index
number with the TableDefs doesn't work like it should.
Dim l_lngCurrentTableDefCount As Long
Set m_dwsCurrent = DBEngine.Workspaces(0)
Set m_objDAORecordSets = New clsDAORecordSets
For l_lngCurrentTableDefCount = 0 To CurrentDb.TableDefs.Count - 1 Step
1
m_objDAORecordSets.Add
CurrentDb.TableDefs(l_lngCurrentTableDefCount).Name
Next l_lngCurrentTableDefCount
l_lngCurrentTableDefCount = 3
CurrentDb.TableDefs(l_lngCurrentTableDefCount).Name
The above line returns "". The Watch Window shows the above Table Def
Object as invalid.
The line below returns the actual name of the table. The Watch Window shows
the below Table Def Object as valid.
CurrentDb.TableDefs(3).Name
What's going on? Do I need to change the data type or just why would this
happen?
--
Thanks,
Ronald R. Dodge, Jr.
Production Statistician
Master MOUS 2000
Access 2002, SP3
MDAC 2.8
DAO 3.60
Using DAO Coding
I have a code within a class module and the variable used for the index
number with the TableDefs doesn't work like it should.
Dim l_lngCurrentTableDefCount As Long
Set m_dwsCurrent = DBEngine.Workspaces(0)
Set m_objDAORecordSets = New clsDAORecordSets
For l_lngCurrentTableDefCount = 0 To CurrentDb.TableDefs.Count - 1 Step
1
m_objDAORecordSets.Add
CurrentDb.TableDefs(l_lngCurrentTableDefCount).Name
Next l_lngCurrentTableDefCount
l_lngCurrentTableDefCount = 3
CurrentDb.TableDefs(l_lngCurrentTableDefCount).Name
The above line returns "". The Watch Window shows the above Table Def
Object as invalid.
The line below returns the actual name of the table. The Watch Window shows
the below Table Def Object as valid.
CurrentDb.TableDefs(3).Name
What's going on? Do I need to change the data type or just why would this
happen?
--
Thanks,
Ronald R. Dodge, Jr.
Production Statistician
Master MOUS 2000