Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello. I added a text box to a form I have. Is there a way to prevent the
user from using the / or \ characters in that form? Thanks! |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
usually i just memorize the values then if it includes something i don't want
i reinstate the old values after update eg.... (this code goes on form module) dim CurVal as string private sub Textbox1_Enter() curval = textbox1 end sub private sub Textbox1_afterupdate() if instr(1,textbox1,"\") 0 or _ if instr(1,textbox1,"/") 0 then _ textbox1 = curval end sub ben -- When you lose your mind, you free your life. "Steph" wrote: Hello. I added a text box to a form I have. Is there a way to prevent the user from using the / or \ characters in that form? Thanks! |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
should say if you want to check it as each character is type I would use this
instead dim CurVal as string Private sub Textbox1_enter() curval = textbox1 end sub Private sub Textbox1_change() if instr(1,textbox1,"\") 0 or _ if instr(1,textbox1,"/") then textbox1 = curval curval = textbox1 end if end sub that other one only reads after a user enters data and leaves the box, this checks each character that is typed -- When you lose your mind, you free your life. "Steph" wrote: Hello. I added a text box to a form I have. Is there a way to prevent the user from using the / or \ characters in that form? Thanks! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Character limit in textbox | Excel Worksheet Functions | |||
255 Character Limit | Excel Discussion (Misc queries) | |||
Character Limit | Excel Programming | |||
how to put tab character into textbox? | Excel Programming | |||
Limit input in a textbox | Excel Programming |