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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can maxLength be set in , Inputbox ?

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
hello,

In a regular text box I know we can control the number of digits that can be inputed, by making adjustments in the
property under MaxLength. But my question is, what if I want to use an Inputbox and want to set the max Length.How do I do that?
Example-> Blah=Inputbox("Please enter a numerical digit.")
An Input box will pop up and as a user to input
some numerical digits. My question is how do I
set the MaxLength , for example like to only
accept only 3 digits?
 
maxChars cannot be set with an inputbox.
create your own "InputBox" ie: std Form, textbox, 2 command buttons(OK, Cancel) and show it modal
 
You could also test the return value, and if it exceeds 3 characters, throw the inputbox back up with a more descriptive message, ie "Please enter a numeric value of up to 3 digits"

Just a thought
 

>create your own "InputBox" ie: std Form, textbox, 2 command buttons(OK, Cancel) and show it modal

Duh?:)Why didnt I thought of that? Thanks you guys,for helping me to become a better VB programmer:)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top