G
GrandMaMa
We have a new software package from a vendor where we must change the Field
Name in a Table.
Two days ago we submitted this and never got the problem resolved. Because
of the field names (Example is HMDA - Interest (numeric)) we cannot use a
query to recreate the new table. The Query will take the above field name
and convert it to (HMDA-Interest(numeric)). This seems to be a problem with
Access 2002 and 2004 that we did not have with Access 2000.
The software firm is shocked that we even were able to delete the original
table because they used assembler to secure it.
Here is the code at this minute!
Dim TableName As String
Dim db As DAO.Database
Dim rst As Recordset
Dim tdf As TableDef
Dim fld As Field
Dim cnt As Byte
Set db = CurrentDb
With db
For Each tdf In .TableDefs
If tdf.Name = "AlphaErrors" Then
TableName = Left(tdf.Name, 11)
db.TableDefs!TableName.Fields![NoFive].Name =
"NoSix" ' Here is the Error
MsgBox "Found Error Table"
End If
Next tdf
End With
The error is Item not found in this collection. Do not know if I have a
Microsoft problem or if my syntax is in-correct.
Thanks Again in Advance
Granny
Name in a Table.
Two days ago we submitted this and never got the problem resolved. Because
of the field names (Example is HMDA - Interest (numeric)) we cannot use a
query to recreate the new table. The Query will take the above field name
and convert it to (HMDA-Interest(numeric)). This seems to be a problem with
Access 2002 and 2004 that we did not have with Access 2000.
The software firm is shocked that we even were able to delete the original
table because they used assembler to secure it.
Here is the code at this minute!
Dim TableName As String
Dim db As DAO.Database
Dim rst As Recordset
Dim tdf As TableDef
Dim fld As Field
Dim cnt As Byte
Set db = CurrentDb
With db
For Each tdf In .TableDefs
If tdf.Name = "AlphaErrors" Then
TableName = Left(tdf.Name, 11)
db.TableDefs!TableName.Fields![NoFive].Name =
"NoSix" ' Here is the Error
MsgBox "Found Error Table"
End If
Next tdf
End With
The error is Item not found in this collection. Do not know if I have a
Microsoft problem or if my syntax is in-correct.
Thanks Again in Advance
Granny