|
-
Apr 18th, 2008, 09:37 AM
#1
Thread Starter
Lively Member
[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?
-
Apr 18th, 2008, 11:48 AM
#2
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.
-
Apr 18th, 2008, 01:22 PM
#3
Thread Starter
Lively Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|