Prev: formatting
Next: A2010 question regarding web app
From: Marshall Barton on 21 Jul 2010 22:41 David Kaye wrote: >Marshall Barton <marshbarton(a)wowway.com> wrote: > >>Sometimes, but not always. IsNumeric will return True for >>anything that can represent a number, even somewhat obscure >>number styles such as: >>+1.234E-3 >>-1.234D+3 >>$12.34- >>$(12.34) >>which makes IsNumeric useless in most situations where you >>might expect it to work. > >I think this is an unnecessary worry. No account number is going to have >those characters. How about: 12345D6 543E21 The original question was to see if it was all digits optionally followed by a letter. Clearly IsNumeric does not detect some failures to meet the requirement. -- Marsh
From: David Kaye on 22 Jul 2010 01:43 Marshall Barton <marshbarton(a)wowway.com> wrote: >How about: >12345D6 >543E21 > >The original question was to see if it was all digits >optionally followed by a letter. Clearly IsNumeric does not >detect some failures to meet the requirement. Dang! Absolutely right. Okay, I'll stick to the solution I posted.
From: Jon Lewis on 22 Jul 2010 04:31 "David Kaye" <sfdavidkaye2(a)yahoo.com> wrote in message news:i27pov$hgm$4(a)news.eternal-september.org... > sfdavidkaye2(a)yahoo.com (David Kaye) wrote: > > Slight correction. Note the 0 to 9 addition: > >>select case right$(str$,1) >> case "A" to "Z", "a" to "z", "0" to "9" >> if maybeok then >> isokay=true >> else >> isokay=false >> end if >> case else >> isokay=false >>end select >> > >
From: Jon Lewis on 22 Jul 2010 04:35
Thanks to all who replied. It's got to be any number of digits 0-9 (no other characters) optionally follwed by a single letter (a-z) so my original way seems as good as any. Jon "David Kaye" <sfdavidkaye2(a)yahoo.com> wrote in message news:i27pov$hgm$4(a)news.eternal-september.org... > sfdavidkaye2(a)yahoo.com (David Kaye) wrote: > > Slight correction. Note the 0 to 9 addition: > >>select case right$(str$,1) >> case "A" to "Z", "a" to "z", "0" to "9" >> if maybeok then >> isokay=true >> else >> isokay=false >> end if >> case else >> isokay=false >>end select >> > > |