I'm not exactly sure what you are trying to accomplish. You can't convert a phrase like "Hello World" to a numeric value or you will get a "Type Mismatch" error.
You can only convert a text string to a number if the text string is comprised of digits.
For example....Let's say you have a textbox on a form and you enter a number into it. Even though what you entered into the textbox looks numerical is will still be a text string because texboxes hold text not numbers. If you debug your code and check the value of the textobx you will see that the number has double quote marks around it because it is text. You can convert a text string such as "1234" into a number 1234 by using any of the following commands. Just replace what is inside the parentheses to your variable or value to convert .
CInt (converts to Integer)
CDbl (converts to double)
CSng (converts to single)
CLng (converts to long)
Regards,
Rollin
Status
Not open for further replies.
You have insufficient privileges to reply here.
Related Threads
?
?
?
?
?
Tech Support Guy
9.9M posts
859.7K members
Since 1998
A forum community dedicated to tech experts and enthusiasts. Come join the discussion about articles, computer security, Mac, Microsoft, Linux, hardware, networking, gaming, reviews, accessories, and more!