Determine data types from VBA

  • Thread starter Nick 'The Database Guy'
  • 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
 
N

Nick 'The Database Guy'

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
 
J

John W. Vinson

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]
 
Top