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

Inputbox max number of chars

Status
Not open for further replies.

slint

Technical User
Jul 2, 2006
48
SE
If i have a inputbox that i would like to lock so that you only could enter 5 chars how can i accomplish that.

I found something that might be right at
Code:
InputBox ("Enter New Computername.", "", "*")

but i have been testing and testing and i can still enter to many chars.

whats wrong??
 
strEntry = ""
While Len(strEntry) <> 5
strEntry = InputBox("Enter a 5 digit string")
Wend

[red]"... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick[/red]
 
you may have to use hta, and set a a text box with a length of 5. i'm not sure you can do it in vbs. ebgreen's idea may work, but it just loops and gives you another inputbox if you don't enter 5 digits.
 
slint,
just a shot in the dark, but have you tried using the InternetExplorer.Application Object? write out a small html window with a text box, which you will specify the size, and have it call a VBScript function on click to get the input.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top