Determine data types from VBA

  • Thread starter Thread starter Nick 'The Database Guy'
  • Start date Start date
N

Nick 'The Database Guy'

I want to determine the data types from VBA so I can appy the correct
formatting to them. I would do it manually, however the data can
change format as it imported from Excel. And I would rather not have
the users poking their noses around in the backend anyway!

TIA

Nick
 
I want to determine the data types from VBA

The datatypes of... what? Table fields? Variables? Query expressions?

John W. Vinson [MVP]
 
The datatypes of... what? Table fields? Variables? Query expressions?

John W. Vinson [MVP]

Sorry John, and anyone else who looked at my little problem. It was
the datatypes of the table fields that I was hoping to discover.

Nick
 
Tables field data types

When I have found them is there any way to change from a numeric types
in to a currency type

Again thanks

Nick
 
When I have found them is there any way to change from a numeric types
in to a currency type

Again thanks

Nick

A Field has a Type property. See the VBA help for "Type Property (DAO)".

There are several ways to change a field type in a table, none of them
particularly simple unfortunately! A SQL DDL query such as

ALTER TABLE yourtable ALTER COLUMN numberfield Currency;

See the Access help for "ALTER TABLE".

John W. Vinson [MVP]
 

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

Back
Top