Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2003

    Question Unanswered: ADODC[Primary KEY]

    I need Help!! I want my Form to accept a unique ID.. it will check if a record already exists in the datbase if so prompt user to chage the inputed value..
    what I did was filter the Database with the inputed value. If it already has a record then a MSGBOX prompts the user that a record already exists
    Here's My CODE:

    ADO.Recordset.Filter = "[emp] = '" & txtEMP.Text & "'"
    'filters data grid displays any record similar to "txtEMP.Text"
    If ADO.Recordset.RecordCount > 1 Then
    'If "txtEMP.Text" exists
    MsgBox "Record Already Exits"
    'prompts user to change "txtEMP.Text"
    'accept the value of "txtEMP.Text"
    End If

    .. any onther way??

  2. #2
    Join Date
    Feb 2002
    How big is your recordset ? It is normally more efficient to execute sql statements rather than loading the entire recordset. Also, what is the uniue ID based on ?

Posting Permissions

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