Changing the format of table fields with code

G

Guest

Hello there,

I'm building a macro that basically runs several queries. However, one of
the queries creates a table (only the structure, not the data) in which 3
fields are dates. These fields are by default formatted as text (since the
original table has the dates in text format). I need help with a piece of
code that would open the new, empty table and change the format of those 3
fields to date/time. Anybody around that can help me out with this?

Thanks!
 
G

Guest

Hello Alex,

I'm not able to work on the original table. It's kind of the master data
table and we are not allowed to touch it since it is live data from an SQL
application.

I agree with you, this cannot be done with macros, that is why I was asking
for help with the code in VBA to do that. After having the code, I can use
the macro to run that procedure or module. Can you help me with the code to
change the format of the table? Thanks!
 
G

Guest

It's possible to do in VBA, but I think there's a much easier solution. In
the query which builds the table, instead of using the field as is, convert
it to date type using datevalue(<fieldname>).
 
G

Guest

Excellent!! Thanks!!!

Lance said:
It's possible to do in VBA, but I think there's a much easier solution. In
the query which builds the table, instead of using the field as is, convert
it to date type using datevalue(<fieldname>).
 

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