Once the Field's been added to the TableDef, its size property is read-only.
What you need to do is:
1) Add a new field of the correct size.
2) Run an Update query to populate the new field with the existing data
3) Delete the old field
4) Rename the new field to the old field's name
5) Compact the database
This is essentially what Access does behind the scenes if you make such a
change through the GUI (other than the compacting part...)
--
Doug Steele, Microsoft Access MVP
<a style='text-decoration: underline;' href="http://I.Am/DougSteele" target="_blank">http://I.Am/DougSteele</a>
(No private e-mails, please)
"Michael A. Gunther" <guntherm RemoveThis @chuckals.net> wrote in message
news:mATUb.40$ek7.45556@news.uswest.net...
> I am using DAO. and a field was created and is incorrect in size, was
> created at 20 char's and I need it to be 25 chars.
>
> Dim tbfNewRecords as DAO.tabledef
> Dim Size as Property
>
> Set tbfNewRecords = datdatabase.tabledefs("New Records")
>
>
> With tbfNewRecords
>
> If .fields("GMAccount").fieldsize = 20 then
> .fields("GMAccount").properties.append
..CreateProperty("Size",dbtext,25)
>
> datdatbase.Tabledefs.append tdfnewRecords
> End if
> End with
>
> Any suggestions?
>
>
>
><!-- ~MESSAGE_AFTER~ -->
>> Stay informed about: Need to change A Field Size