[AccessD] Change Field Size

Rocky Smolin - Beach Access Software bchacc at san.rr.com
Sun Dec 4 11:44:36 CST 2005


Dear List:

Close, but no cigar.

I need to change the length of a field through code.  I've got:

Set wrk = DBEngine.Workspaces(0)
Set db = wrk.OpenDatabase(gstrDatabaseName)
Set tdf = db.TableDefs("tblPODetail")


    Set fld = tdf.Fields("fldPODPartDescription")
    fld.Properties("AllowZeroLength") = True
    fld.Properties("FieldSize") = 255
    tdf.Fields.Append fld

Set fld = Nothing
Set tdf = Nothing
Set db = Nothing
Set wrk = Nothing

but fld.Properties("FieldSize") = 255  errors with "property can only be set when the Field is part of a Recordset object's field collection.

What am I doing wrong?

MTIA,

Rocky Smolin
Beach Access Software
http://www.e-z-mrp.com
858-259-4334


More information about the AccessD mailing list