Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

textbox control

Status
Not open for further replies.

354688

Instructor
May 5, 2001
7
0
0
GB
Hi

I have a textbox on my form that I would like to restrict spaces from being entered and force characters inputted to be uppercase. Data entered can vary so can't really see an input mask working here.
 
How are ya 54688 . . .

Try the following in the [blue]On Key Press[/blue] event of the control:
Code:
[blue]   If KeyAscii > 96 And KeyAscii < 123 Then
      KeyAscii = (KeyAscii And 223)
   ElseIf KeyAscii = 32 Then
      KeyAscii = 0
   End If[/blue]

[blue]Your Thoughts? . . .[/blue]

See Ya! . . . . . .

Be sure to see faq219-2884 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
Brillant. Thank you very much. You have saved me hours trying to work this out by my selft.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top