
Change a field property via VBA??
I'm not sure that I fully understand your question. I'm not sure
why you want to modify the table definition in code rather than
using Access. However, one technique that I have tried when
I am upgrading versions of an application and I have to change
my database schema is as follows:
1. I create a new table def, copy the data from one table to the
new table (with the appropropriate data conversion written into
my action query)
2. Delete (or rename - this is safer!) the old table
3. Rename the new table.
I'm sure that you could change the data type in code, however
if there is existing data in the table when you change the data type,
Access/Jet might make some noise about it.
To learn about changing data types in code, check the following
topic in the DAO Reference:
Field Object, Fields Collection Summary
Then scroll down to Type and study that topic.
Hope this helps,
David
Quote:
> Hi,
> I want to change a table field's property from Text to Date/Time Short
Date
> setting. I can't find any book that describes how to do it.
> If the table's name is TableX and the field's name is FieldY, what would
the
> code be?
> Thank you!!