Macro: Changing the field type from tx to date in Macros

A

annied

Hi,

I had a tx field (that should have been a date field) it read 20000101 I’ve
separated the tx in a qry and brought it back together in the right order 01
/01/2000 but it is still registering as a tx field,… i could simply go in an
d change the format of the field in the table design, but i have hundreds of
tables and thousands of these tx fields that should be dates. I need to wri
te a macro to take my updated field (01/01/2000) and format it in to
date/time.

Is this possible? and can anyone help me out with this one, because i'm
v-new to VBA and macros in general. Any help would be gratefully appreciated.

Annie
 
D

Douglas J Steele

What exactly do you mean by "still registering as a tx field"? Is this a
field in a table? Changing how it looks will not change the field's type
from Text to Date/Time.

If it is in a table, add a new Date/Time field and write an Update query to
populate that new field from the existing field.
 
A

annied

Hi,

I realise changing how the data looks will not convert the format in to
date/time and i also realise that i can easily update the field manually.
However, my problem is i have thousands of fields within hundreds of
different tables imported from CSV files, it would take me forever to do this
manually, which is why i was hoping to be able to do it using a macro.
 
D

Douglas J Steele

It's not possible to do using a macro.

You can, however, write VBA code to add the new field, create and run the
appropriate Update query and delete the old field.

I'm afraid that's as specific as I can be without more details.
 

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