Results 1 to 6 of 6

Thread: check length

  1. #1
    Join Date
    May 2004
    Posts
    86

    Unanswered: check length

    i want to be able to make sure the user enters atleast ten bytes or ten spaces in valdation any help

  2. #2
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    Len(yourValue)

    Want more help? Provide more information.

    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  3. #3
    Join Date
    May 2004
    Posts
    86

    ok here we go

    i have a feild called allowed i want the user to enter a minium of
    0000000000 or greater, Where whould i palce this len()

    thanks

  4. #4
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    place it in the before update event of the control or form, with a cancel=true if the field is less than 10 digits
    eg
    if len(fieldxx)<=9 then
    'insert other code here eg msgbox
    cancel=true
    endif

  5. #5
    Join Date
    May 2004
    Posts
    86

    Problem

    this is what i used in the before update. im trying to check text boxes to se eif the length is atleast ten bytes

    Private Sub Form_BeforeUpdate(Cancel As Integer)
    If Len(CFR_ALLOWED) < 9 Then
    MsgBox "Please enter a Patient SSN", vbOKOnly, "Invalid Search Criterion!"
    Me![Text370].SetFocus
    Cancel = True
    End If
    End Sub

    this is not working any suggestions

  6. #6
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    what test data is causing the problem
    the code provided whould report an error if the ssn is 8 characters or less

Posting Permissions

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