Public Function FindFieldName(strTblName As String, strFldName As String) As
Boolean
Dim tdfs As TableDefs
Dim tdf As TableDef
Dim flds As Fields
Dim fld As Field
On Error GoTo FindFieldName_Error
FindFieldName = False
Set tdfs = CurrentDb.TableDefs
Set tdf = tdfs(strTblName)
Set flds = tdf.Fields
For Each fld In flds
If fld.Name = strFldName Then
FindFieldName = True
Exit For
End If
Next fld
FindFieldName_Exit:
On Error Resume Next
Exit Function
FindFieldName_Error:
If Err.Number = 3265 Then
MsgBox "Table " & strTblName & " Not Found"
Else
MsgBox "Error " & Err.Number & " (" & Err.Description & _
") in procedure FindFieldName of Module modUtilities"
End If
GoTo FindFieldName_Exit
End Function