"%" character

W

Wavequation

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?
 
A

Allen Browne

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top