I need to check to see if a field exists in a recordset. I've tryed the following code but it doesn't work. It returns the same result whether it exists or not. Does anyone have a better idea? It will be greatly appreciated.
Dim fld as Field
On Error Resume Next
Set fld = Recordset.Fields("FieldName")
If Err.Number <> 0 Then
' Field does NOT exist
Else
' It does
End If
BTW, I got this code from a much earlier thread I found.
Thanks,
Dan
Dan Rogotzke
Dan_Rogotzke@oxy.com
Dim fld as Field
On Error Resume Next
Set fld = Recordset.Fields("FieldName")
If Err.Number <> 0 Then
' Field does NOT exist
Else
' It does
End If
BTW, I got this code from a much earlier thread I found.
Thanks,
Dan
Dan Rogotzke
Dan_Rogotzke@oxy.com