Limit input into field

  • Thread starter Thread starter Kevin Baker
  • Start date Start date
K

Kevin Baker

Hi Everyone!

I have a 9 digit field as listed below:

5001-9700

The 5001 is the julian date (military style) and the 9700 is the first
number in my series.. I would like to restrict the user when entering the
series.. the series goes from 9700 - 9899, how can I do this?

Thanks,
Kevin
 
Is this input in a text box on a form? If so, in the Before Update event of
the control:

If Val(Right(Me.txtControlName),4) < 9700 Or _
Val(Right(Me.txtControlName),4) > 9899 Then
MsgBox "You Screwed Up, Dummy!"
Cancel = True
End If

Also, create an input mask for the control "0000-0000"
 
Back
Top