![]() |
limit character in textbox
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! |
limit character in textbox
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! |
limit character in textbox
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! |
All times are GMT +1. The time now is 08:37 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com