RE: Required Field for 7 Numeric digits only



This should cover it all, needed to make the loop so they have to respond.

RETRY:
UserInput = Application.InputBox("Enter an seven numeric digits", _
"NUMERIC ONLY", Type:=1)
If UserInput = "" Or UserInput = False Or Len(UserInput) <> 7 Then
MsgBox "You must enter numbers only."
GoTo RETRY:
End If


"LRay67" wrote:

I have a required field that can contain only 7 numeric digits within the
textbox. Also want to put in a message box to alert them that this field
must have 7 numeric digits. Any suggestions on how to write the code behind
this? Thanks

Linda
.



Relevant Pages

  • RE: Required Field for 7 Numeric digits only
    ... MsgBox "You must enter numbers only." ... "LRay67" wrote: ... textbox. ... Also want to put in a message box to alert them that this field ...
    (microsoft.public.excel.programming)
  • Re: Form coding help please
    ... At the moment i have tried the following code in the forms beforeupdate event ... for the postcode textbox problem ... MsgBox "Please enter 'Y' or 'N' only", ... The postcode textbox however is giving me a serious headache. ...
    (microsoft.public.access.formscoding)
  • Re: Oh the machinations!
    ... In your "If" statement below, instead of MsgBox, set the Visible = True ... > The radio button list are values 1-5. ... > 'comments' in the textbox are required. ... code executes on the Web server. ...
    (microsoft.public.dotnet.framework.aspnet)
  • RE: TextBox Focus And Active Cursor Movement In User Forms
    ... HOWEVER, if I render the error message ON THE FORM, and not use MsgBox, it's ... Private Sub txtTotalUnits_Exit(ByVal Cancel As MSForms.ReturnBoolean) ... the textbox, and return the blinking cursor to that same textbox... ...
    (microsoft.public.excel.programming)
  • Re: Controls.Add Requires MsgBox
    ... I have a Controls.Add which works only if a MsgBox ... I have a SampleText class which consists of a RichTextBox and 6 buttons. ... The class contains a MouseHover event handler for the RichTextBox. ... to place the TextBox on the usercontrol which is not where I want it placed. ...
    (microsoft.public.dotnet.languages.vb)

Loading