PC Review


Reply
Thread Tools Rate Thread

"%" character

 
 
Wavequation
Guest
Posts: n/a
 
      5th Jun 2010
I am using the following code:

Val(strValue)

where strValue = "0.1%"

I am getting a type mismatch error.. what does the "%" character do to a
string?
 
Reply With Quote
 
 
 
 
Allen Browne
Guest
Posts: n/a
 
      5th Jun 2010
As you found, Val() can't handle strings that are formatted with characters
such as % or $. Divide the value by 100, i.e. use:
0.001

In what context do you need such a value entered? If it is an unbound text
box, set its Format property to Percent, and it will be understood correctly
as a numeric value.

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.


"Wavequation" <(E-Mail Removed)> wrote in message
news:31D8D7B4-4C76-4C0C-8FDE-(E-Mail Removed)...
> I am using the following code:
>
> Val(strValue)
>
> where strValue = "0.1%"
>
> I am getting a type mismatch error.. what does the "%" character
> do to a string?


 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to delete a "return" character (a "box") in cell of imported d JaxHBT Microsoft Excel Programming 1 12th Aug 2008 10:39 PM
Change "-" from right first character to left first character to make a negative amount amorrison2006@googlemail.com Microsoft Excel Programming 2 27th Jul 2007 03:54 PM
how to replace "enter character" with "space character" in msword =?Utf-8?B?TVMtV29yZA==?= Microsoft Word Document Management 1 19th Dec 2006 05:26 AM
How do I to stop "£" character from arriving as "#" characters? Shiperton Henethe Microsoft Outlook 3 20th Jan 2005 05:33 PM
Sum a range of cells with without the first character "text" & "numerical" John Microsoft Excel Worksheet Functions 5 12th Sep 2004 07:56 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:54 PM.