For Each tdfLoop In db.TableDefs
If tdfLoop.NAME = TableOfInterest Then
For x = 0 To tdfLoop.Fields.Count - 1
If tdfLoop.Fields(x).NAME = Fname Then
MsgBox "Found Field of interest"
'Can do whatever you want here
End If
Next x
End If
Next tdfLoop
Btw - I would post these sorts of questions in this group : forum181 will get a better response.
* NOTE: All of the following assumes you copied the earlier example code verbatim.
You just lost a "b" in "db". (The other day, I lost a whole assignment statement; for fifteen minutes, I couldn't figure out why my control's value stopped updating.)
Code:
For Each td in d.TableDefs
should be
Code:
For Each td in db.TableDefs
You did not have any object called "d" so VBA flagged the reference to *a variable that had not been set* when you tried to reference the Tabledefs property of d (
Code:
d.Tabledefs
doesn't exist, but
Code:
db.TableDefs
does).
Have a good one!
-- C Vigil =)
(Before becoming a member, I also signed on several posts as
"JustPassingThru" and "QuickieBoy" -- as in "Giving Quick Answers"
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.