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

Text Box Lenght

Status
Not open for further replies.

Finedean

MIS
May 4, 2006
80
US
Hi,
I need help on the following:
I have an input form with a combo box and a text box. I would like the text box to allow only 8 Numbers if combo box is equal to Liberty, if combo box is equal to LNT then allow 11 characters ( these 11 characters will alwyas start with HN Like this: HN123456732)

Thanks in advance

Dean
 
In the combo's AfterUpdate event, set the input mask of the textbox:
Code:
Select Case Me!cmbMyCombo
    Case "Liberty"
        Me!txtMyTextbox.InputMask = "00000000"
    Case "LNT"
        Me!txtMyTextbox.InputMask = "HN000000000"
    Case Else
        Me!txtMyTextbox.InputMask = ""
End Select
HTH,

Ken S.
 
Wow that was fast. Worked great. Thanks soooo much Eupher
Dean
 
p.s. The input masks specified above require 8 and 9 numeric characters, respectively. If the length may be shorter, i.e. up to 8/9 but not more than, then use 9's instead of 0's in the mask strings.

Ken S.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top