Runtime error 13 Incompatible types

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
 
R

Rob Oldfield

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top