Solved

Access 2007 vba convert text to decimal

Posted on 2011-02-28
7
735 Views
Last Modified: 2013-11-27
I have several text (50) records that are imported thru an ODBC connection that reads ie 32.9.   I would like to convert to a number with one decimal point.   How do I convert it in VBA.
0
Comment
Question by:glomo82
  • 4
  • 2
7 Comments
 
LVL 75
ID: 35002994
csng("32.1")
returns
32.1 numeric

mx
0
 
LVL 75

Accepted Solution

by:
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform) earned 250 total points
ID: 35002997
CSng(YourField)  to be exact
0
 
LVL 44

Expert Comment

by:GRayL
ID: 35003355
CDbl(myFld,"#.0")
0
Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

 
LVL 75
ID: 35003368
But why change to Double that takes the storage ?
0
 
LVL 75
ID: 35003376
> That takes twice the storage ?
0
 
LVL 44

Expert Comment

by:GRayL
ID: 35003397
I was never told the value could not exceed 32768
0
 

Author Closing Comment

by:glomo82
ID: 35003473
Thanks a bunch
0

Featured Post

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

As with any other System Center product, the installation for the Authoring Tool can be quite a pain sometimes. This article serves to help you avoid making these mistakes and hopefully save you a ton of time on troubleshooting :)  Step 1: Make sur…
Deploying a Microsoft Access application in a Citrix environment is not difficult but takes a few steps. However, Citrix system people are often of little help, as they typically know next to nothing about Access. The script provided here will take …
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question