Determine data types from VBA

  • Follow


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

0
Reply Nick 4/23/2007 3:59:29 PM

On 23 Apr 2007 08:59:29 -0700, Nick 'The Database Guy'
<nickmcm@btinternet.com> wrote:

>I want to determine the data types from VBA 

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

             John W. Vinson [MVP]
0
Reply John 4/23/2007 5:13:48 PM


On 23 Apr, 17:13, John W. Vinson <jvinson@STOP_SPAM.WysardOfInfo.com>
wrote:
> On 23 Apr 2007 08:59:29 -0700, Nick 'The Database Guy'
>
> <nick...@btinternet.com> wrote:
> >I want to determine the data types from VBA
>
> 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

0
Reply Nick 4/24/2007 7:59:08 AM

On 23 Apr, 17:13, John W. Vinson <jvinson@STOP_SPAM.WysardOfInfo.com>
wrote:
> On 23 Apr 2007 08:59:29 -0700, Nick 'The Database Guy'
>
> <nick...@btinternet.com> wrote:
> >I want to determine the data types from VBA
>
> The datatypes of... what? Table fields? Variables? Query expressions?
>
>              John W. Vinson [MVP]

Tables field data types

0
Reply Nick 4/24/2007 8:03:38 AM

On 24 Apr, 08:03, Nick 'The Database Guy' <nick...@btinternet.com>
wrote:
> On 23 Apr, 17:13, John W. Vinson <jvinson@STOP_SPAM.WysardOfInfo.com>
> wrote:
>
> > On 23 Apr 2007 08:59:29 -0700, Nick 'The Database Guy'
>
> > <nick...@btinternet.com> wrote:
> > >I want to determine the data types from VBA
>
> > The datatypes of... what? Table fields? Variables? Query expressions?
>
> >              John W. Vinson [MVP]
>
> 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

0
Reply Nick 4/24/2007 9:15:47 AM

On 24 Apr 2007 02:15:47 -0700, Nick 'The Database Guy'
<nickmcm@btinternet.com> wrote:

>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]
0
Reply John 4/24/2007 4:39:52 PM

5 Replies
560 Views

(page loaded in 0.974 seconds)

Similiar Articles:
















7/26/2012 12:46:28 PM


Reply: