A
Always Learning
Hi Guys,
Can you help me?
I want to loop through all the fields in all the tables looking for a
certain value in a field. The piece of code below can get me the table name
and the field name but I can not find out how to get the field value.
(tdf.Name gets me the table name ) (fld.Name gets me the field name)
fld.value will not get me the field value.
does anyone know?
Dim db As Database
Dim tdf As TableDef
Dim fld As Field
Set db = DBEngine(0)(0)
For Each tdf In db.TableDefs
If Left(tdf.Name, 4) <> "MSys" Then
Debug.Print "** " & tdf.Name
For Each fld In tdf.Fields
Debug.Print fld.Name
If InStr(1, fld.Value,"UPGRADE") Then
MsgBox (" Value = " & fld.Value & " Table = " & tdf.Name)
End If
Next fld
End If
Next tdf
Your help is greatly appreciated.
Best Regards,
Steve Wilson.
Can you help me?
I want to loop through all the fields in all the tables looking for a
certain value in a field. The piece of code below can get me the table name
and the field name but I can not find out how to get the field value.
(tdf.Name gets me the table name ) (fld.Name gets me the field name)
fld.value will not get me the field value.
does anyone know?
Dim db As Database
Dim tdf As TableDef
Dim fld As Field
Set db = DBEngine(0)(0)
For Each tdf In db.TableDefs
If Left(tdf.Name, 4) <> "MSys" Then
Debug.Print "** " & tdf.Name
For Each fld In tdf.Fields
Debug.Print fld.Name
If InStr(1, fld.Value,"UPGRADE") Then
MsgBox (" Value = " & fld.Value & " Table = " & tdf.Name)
End If
Next fld
End If
Next tdf
Your help is greatly appreciated.
Best Regards,
Steve Wilson.