Runtime error 13 Incompatible types

  • Thread starter Thread starter Fia
  • Start date Start date
F

Fia

Hi
When I use the code below

Sub FieldOutput( )
Dim prpLoop As Property
Dim db as Database
Dim fldTemp As Field
set db= OpenDatabase(CurrentDb.Name)
Set fldTemp= db.TableDefs(0).Fields(0)

For Each prpLoop In fldTemp.Properties
Debug.Print " " & prpLoop.Name & " = " & _
prpLoop.Value
Next prpLoop

End Sub
I get the run error Incompatible types at row "For Each prpLoop In
fldTemp.Properties" and
 
I can't reproduce the exact error, but I think it's because you have a
reference to ADO. Lose it (if you don't need it) or explicitly declare
prploop as DAO by

Dim prpLoop As DAO.Property
 
Back
Top