Group:  Microsoft Access ยป microsoft.public.access.formscoding
Thread: Validating first input character

Geek News

Validating first input character
TeeSee <bkeanie[ at ]glasscellisofab.com> 12/15/2008 11:21:59 PM
Win XP and MA2003

Currently have a TextBox control where user is required to input a
percent value as .25 as an example. How can I capture the fact that
the first character input is a "." and not a "2" or vice versa for
instance. If the input is not as required then MsgBox etc .....

I think I have to turn the number into a string to test it but can't
seem to find how to do that. I have searched the group but can't
resolve. Would appreciate any suggestions or better ways to
accomplish.
Thanks as usual.
Re: Validating first input character
"Jeff Boyce" <nonsense[ at ]nonsense.com> 12/16/2008 1:00:19 AM
I don't know anything about the data you are working with...

Is it possible that one time the value would be 25% (i.e., .25), but another
time, it would be a quarter of a percent (i.e., .0025)?

Regards

Jeff Boyce
Microsoft Office/Access MVP

"TeeSee" <bkeanie[ at ]glasscellisofab.com> wrote in message
news:896b0461-0228-4816-8e90-0bb5651383e3[ at ]w34g2000yqm.googlegroups.com...
[Quoted Text]
> Win XP and MA2003
>
> Currently have a TextBox control where user is required to input a
> percent value as .25 as an example. How can I capture the fact that
> the first character input is a "." and not a "2" or vice versa for
> instance. If the input is not as required then MsgBox etc .....
>
> I think I have to turn the number into a string to test it but can't
> seem to find how to do that. I have searched the group but can't
> resolve. Would appreciate any suggestions or better ways to
> accomplish.
> Thanks as usual.


Re: Validating first input character
"Jeff Boyce" <nonsense[ at ]nonsense.com> 12/16/2008 4:29:40 PM
Another hint ... if you are ONLY capturing percentages, you may not be able
to legitimately compare them. Since percents are calculated as numerator
divided by denominator, the only way two percentages can be 'averaged' or
otherwise mathematically manipulated is if they share the SAME denominator.
After all, 10% of 10 items and 10% of 1,000,000 is NOT the same.

More specific description could help with more specific suggestions...

Regards

Jeff Boyce
Microsoft Office/Access MVP

"TeeSee" <bkeanie[ at ]glasscellisofab.com> wrote in message
news:896b0461-0228-4816-8e90-0bb5651383e3[ at ]w34g2000yqm.googlegroups.com...
[Quoted Text]
> Win XP and MA2003
>
> Currently have a TextBox control where user is required to input a
> percent value as .25 as an example. How can I capture the fact that
> the first character input is a "." and not a "2" or vice versa for
> instance. If the input is not as required then MsgBox etc .....
>
> I think I have to turn the number into a string to test it but can't
> seem to find how to do that. I have searched the group but can't
> resolve. Would appreciate any suggestions or better ways to
> accomplish.
> Thanks as usual.


Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net