You can use the left function to determine if the first letter is a 'P'. You can check this in the validate ot lost focu event.
if left(text1,1)="P" then...
Add the UCase function if it is not case sensitive.
if Ucase(left(text1,1))="P" then...
Another method would be to seed the text box with a "P" before the user eneters anything. Or use the keypress event to only allow the first letter to be a "P".
if len(text1)=0 then
if not keyascii=<value> then keyascii=0
end if
Where <value> is the ascii value for the letteer 'P'. You will need to look that up in the ascii character set.
Thanks and Good Luck!
Will it matter whether it's a lower-case "p" or is it
okay to always have it an uppercase "P"?
Alternatively, you can add code to ALWAYS add a "P" to
whatever the user writes in the text box.
Also, you may check out input boxes. They're similar to
text boxes.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.