The way I wrote that, you would need :
Dim lngBytes As Long
Dim prp As Property
Set prp = fld.Size
lngBytes = prp.Value
which, as I look at it is the long way around. Let's just
replace the Set prp line with
Dim lngBytes As Long
lngBytes = fld.Size

Signature
Marsh
MVP [MS Access]
>Using either of the methods suggested, I get a type mismatch error when I set
>fld line. For reference my field is called item1.
[quoted text clipped - 27 lines]
>> Set fld = tdf.Fields!fieldname
>> Set prp = fld.Size
It looks like you have both DAO and ADODB referenced, but ADODB is
higher in the list. Since both libraries have a Field object, fld is
getting implicitly defined as ADODB.Field when tdf.Fields![item1]
returns a DAO.Field object. Either:
A)Change the declaration to
Dim fld as DAO.Field
B)List DAO in your references higher than ADODB (if you use it)
C)Drop your reference to ADODB (if you don't use it)
HTH,
Kevin
> Using either of the methods suggested, I get a type mismatch error when I set
> fld line. For reference my field is called item1.
[quoted text clipped - 29 lines]
>>Set fld = tdf.Fields!fieldname
>>Set prp = fld.Size
vtj - 10 Jan 2006 17:00 GMT
The note to include DAO in Dim statement fixed problem. Thank You Very Much!!!
> It looks like you have both DAO and ADODB referenced, but ADODB is
> higher in the list. Since both libraries have a Field object, fld is
[quoted text clipped - 44 lines]
> >>Set fld = tdf.Fields!fieldname
> >>Set prp = fld.Size
Marshall Barton - 10 Jan 2006 17:52 GMT
I have no idea how you were able to deduce the problem,
maybe the type mismatch was the clue?
However you did it, it was a great catch Kevin.

Signature
Marsh
MVP [MS Access]
>It looks like you have both DAO and ADODB referenced, but ADODB is
>higher in the list. Since both libraries have a Field object, fld is
[quoted text clipped - 32 lines]
>>>>I have worked with the VBA enough to know that I'll bet the field legth
>>>>exists and I am just not getting the right question to the system.