check for "T" or "B"

madEG

Registered User.
Local time
Today, 13:22
Joined
Jan 26, 2007
Messages
307
Arg,

I am testing a text entry box to see that a code entered into a form begins with the letters T or B, and am receiving a 13 type mismatch error.

Ideas?

Left(Me.VolumeLabel.Value, 1) <> ("B" Or "T")

Left(Me.VolumeLabel.Value, 1) <> ( char(66) Or char(84) )

Thanks! :)
 
For starters, I think you use .caption for a label not .value.

???

Edit: Second, You need to check each one seperately...
 
Ahh, doing each check separately worked out. Thanks so much!

Sometimes it really helps having another set of eyes help you...
 
If Asc(Me.YourControlName) = 66 OR Asc(Me.YourControlName) = 84 Then
...using YourControlName of course!
Asc() looks at the 1st character of a string.
 
If Asc(Me.YourControlName) = 66 OR Asc(Me.YourControlName) = 84 Then
...using YourControlName of course!
Asc() looks at the 1st character of a string.

Nice. Thanks!
 

Users who are viewing this thread

Back
Top Bottom