Results 1 to 4 of 4

Thread: got stuck

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2000
    Posts
    1
    I want to perform three validations
    on a particular field.the field is of
    textbox type.Fieldname - code-primary key
    the 3 validations are
    1)cannot leave it blank
    2)duplication check
    3)only enter in this format 'D001'
    cannot get this done
    Problem-if one works another stops working
    and so on
    soln- i want all three should work together
    NB-i have used lostfocus of textbox.
    Iteration being if then...else
    tried with select case,elseif,do while...loop
    but did not work

  2. #2
    Lively Member
    Join Date
    Mar 2000
    Location
    Germany
    Posts
    84
    Hi,

    I didn't know exactly what you mean with duplication check ...
    However, for the other two validations I have a suggestion

    hope this helps

    Nina
    ___________________________________________

    Code:
    Private Sub Text1_Validate(KeepFocus As Boolean)
    
     If Text1 = "" Then
        KeepFocus = True
        MsgBox "...", , "Invalid Entry in Textbox"
        Exit Sub
     End If
    
     If Not Text1 Like "[D]###" Then
        KeepFocus = True
        MsgBox "Doesn't match required pattern", , "Invalid Entry in Textbox"
        Exit Sub
     End If
    
     '+ code for 3rd validation
    
    End Sub
    [Edited by Nina on 03-22-2000 at 08:17 AM]

  3. #3
    Hyperactive Member
    Join Date
    Feb 2000
    Location
    Sedgefield
    Posts
    337
    Could you use a combobox? You can then do the duplicate validation against the members of the list.

    A valid entry would then be add to the list so duplicates of THAT could not be entered.



    Dan

  4. #4
    Hyperactive Member
    Join Date
    Nov 1999
    Posts
    363
    If this is an incremental value that is used just as the key, could you determine what the next key value should be and automatically populate (and disable) the control?
    Wade

Posting Permissions

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



Click Here to Expand Forum to Full Width