Results 1 to 3 of 3

Thread: [RESOLVED] ADO Control - Check if a Certain Record Doesn't Exist

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Apr 2008
    Posts
    101

    Resolved [RESOLVED] ADO Control - Check if a Certain Record Doesn't Exist

    My program allows users to create new records by clicking a command button. A series of input boxes appear so the user can enter the details. However, for the first input box, I want the user to enter a ColleagueID record, and if it exists, it will ask the user to try again.

    How do I make such a check? Using SQL?

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: ADO Control - Check if a Certain Record Doesn't Exist

    Run a SELECT query for what was input.

    If a record is returned, you know it exists. If no records are returned you know it does not exist.

    You could also do a SELECT COUNT for what was input. If the return is greater than 0 then it exists. If it is 0 then it doesn't.

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Apr 2008
    Posts
    101

    Re: ADO Control - Check if a Certain Record Doesn't Exist

    Thanks a lot - you've both resolved this.

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