Programmatically changing the field formats for a table

W

walters

Is there a way, either through a macro, query or VB coding
to change the formats of fields in a table that was
created using a query. When a make-table query is run,
the resulting table does not keep the field formats of the
original table. How can I get them back?
 
R

Roger Carlson

The easiest thing to do is create your table ahead of time (either manually
or programmatically) and then Append data to that table.

If you can't do that, it can still be done, but it requires a lot of coding.
You can modify some properties of a field with SQL statements, but others
must use DAO methods. (I assume we are talking about Access tables rather
than an ODBC source like Oracle.)

On my website is a small sample database called SQLDAOLoader.mdb. Its
purpose is to allow the update of a remote database, but will work with
native tables. It has separate functions to modify each property of a
field. You store the steps in a table called UpdateSteps, which the code
runs through sequentially to modify the indicated tables.

Of course, you could hard code a function to do this, but then you would
have to do this for each table.

Take a look at my sample and see if you can figure out what it is doing.
 
W

walters.b

Thanks! I will check it out.
-----Original Message-----
The easiest thing to do is create your table ahead of time (either manually
or programmatically) and then Append data to that table.

If you can't do that, it can still be done, but it requires a lot of coding.
You can modify some properties of a field with SQL statements, but others
must use DAO methods. (I assume we are talking about Access tables rather
than an ODBC source like Oracle.)

On my website is a small sample database called SQLDAOLoader.mdb. Its
purpose is to allow the update of a remote database, but will work with
native tables. It has separate functions to modify each property of a
field. You store the steps in a table called UpdateSteps, which the code
runs through sequentially to modify the indicated tables.

Of course, you could hard code a function to do this, but then you would
have to do this for each table.

Take a look at my sample and see if you can figure out what it is doing.

--
--Roger Carlson
www.rogersaccesslibrary.com
Reply to: Roger dot Carlson at Spectrum-Health dot Org

"(e-mail address removed)"


.
 

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