Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Forcing Data Type 1

Status
Not open for further replies.

ccma

MIS
Oct 23, 2003
23
0
0
US
Hi~
Is there a way in which you can force a data type with VBA?

I have a table that is imported into a database(97)from an application called Monarch. One of the fields has a letter before a number - Monarch extracts the letter and changes the field to text before importing. (Monarch will not allow for changes in data type.) If the fields data types between the two applications don't match Monarch will not export into the database so in Access the field data type is also set to Text. The field should really be numeric and not text.
I need to make calculations off of this field but access will not allow me to - due to invalid data type. I know I can manually change it but I would much rather have it automatically change with a code -- if that is at all possible.

Any ideas would be greatly appreciated!!

 
see the val() function in access help
 
Clearly the data with a letter is not numeric. Can't you declare the data to Monarch as two fields?

 
What happens is the following---

CSA# Pmt Accts
345 1429.77 7 P
346 1800.89 52
347 41333.80 121

The field spacing is not consistent -- I need all numbers under Accts and if the number is a one digit number it does not set three spaces before starting the next column. I used the Val function and it worked. Thanks. CC
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top