Results 1 to 6 of 6
  1. #1
    5 Star Lounger bfxtrfcmgr's Avatar
    Join Date
    Aug 2002
    Location
    Fresno, California, USA
    Posts
    995
    Thanks
    12
    Thanked 0 Times in 0 Posts

    Validation Rule (2002)

    Well. . .I know what doesn't work.

    field text size = 6
    Must be between four and six characters (all caps).

    = Between (>"????") And (>"??????") . . . . boom!
    Bryan,
    Not the smartest critter on the glacier. . .
    . . .but I'm persistent (does that count?)

  2. #2
    4 Star Lounger
    Join Date
    Sep 2004
    Location
    Sacramento, California, USA
    Posts
    432
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Validation Rule (2002)

    From table design you could use an Input Mask of:
    LLLL??
    This makes 4 required letters and 2 optional
    To force all caps set the format property to:
    >

    Hope this helps,
    Carla

  3. #3
    5 Star Lounger bfxtrfcmgr's Avatar
    Join Date
    Aug 2002
    Location
    Fresno, California, USA
    Posts
    995
    Thanks
    12
    Thanked 0 Times in 0 Posts

    Re: Validation Rule (2002)

    Thanks Carla!

    I have that in the input mask, but all you get if you violate those parameters is an obscure Access msg that you did something wrong -- not what it is that you did wrong. Hense the need for a validation rule/msg.
    Bryan,
    Not the smartest critter on the glacier. . .
    . . .but I'm persistent (does that count?)

  4. #4
    4 Star Lounger
    Join Date
    Sep 2004
    Location
    Sacramento, California, USA
    Posts
    432
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Validation Rule (2002)

    You could set the Input Mask in table design, and force all uppercase characters using the format property. Then you could control the message box by using a form to enter data into your table. You can capture the error code triggered by the system message and replace it by using th forms OnError event. Something like this:

    Private Sub Form_Error(DataErr As Integer, Response As Integer)
    'DataErr 2279 is and input mask error
    If DataErr = 2279 Then
    MsgBox "You must enter between 4 and 6 letters"
    Response = acDataErrContinue
    Else
    Response = acDataErrDisplay
    End If
    End Sub

    Carla

  5. #5
    5 Star Lounger bfxtrfcmgr's Avatar
    Join Date
    Aug 2002
    Location
    Fresno, California, USA
    Posts
    995
    Thanks
    12
    Thanked 0 Times in 0 Posts

    Re: Validation Rule (2002)

    Thanks again!!
    This seems to work just fine. . .and no code. (Important for people like me) <img src=/S/confused.gif border=0 alt=confused width=15 height=20>
    Bryan,
    Not the smartest critter on the glacier. . .
    . . .but I'm persistent (does that count?)

  6. #6
    4 Star Lounger
    Join Date
    Sep 2004
    Location
    Sacramento, California, USA
    Posts
    432
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Validation Rule (2002)

    Bryan,

    Code is not always the only solution. Thank you for posting back your solution.

    Carla

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •