hello all
Consider the code fragment below. I loop through a set of tables in an mdb file. If the table matches "tbl_*", then I call a function.
This works PERFECTLY.
BUT, I want to add another condition before calling the function - I want to only call the function if the table field called sType = "K".
The code below that is in red doesn't work.
Could some guru out there tell me how to do this?
thanks in advance!
Vickt C
Consider the code fragment below. I loop through a set of tables in an mdb file. If the table matches "tbl_*", then I call a function.
This works PERFECTLY.
Code:
Dim db As DAO.Database, tdf As DAO.TableDef
...
Set db = Workspaces(0).OpenDatabase(strExternalPathName)
For Each tdf In db.TableDefs
If tdf.Name Like "tbl_*" Then
Call CountTableSymmetricRecords(strExternalPathName, tdf.Name)
End If
Next
BUT, I want to add another condition before calling the function - I want to only call the function if the table field called sType = "K".
The code below that is in red doesn't work.
Could some guru out there tell me how to do this?
Code:
Dim db As DAO.Database, tdf As DAO.TableDef, fld As DAO.Field
...
Set db = Workspaces(0).OpenDatabase(strExternalPathName)
For Each tdf In db.TableDefs
If tdf.Name Like "tbl_*" Then
[b][COLOR=#CC0000] Set fld = tdf.Fields("sType")
If fld.Value = "K" Then[/color][/b]
Call CountTableSymmetricRecords(strExternalPathName, tdf.Name)
End If
End If
Next
thanks in advance!
Vickt C