473,327 Members | 2,094 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

"ADODC.recordset.find" Method

lee123
556 512MB
in my code i am using this syntax:

Expand|Select|Wrap|Line Numbers
  1. Private Sub mnuName_Click()
  2.         Dim str As String
  3.         Adodc1.Recordset.MoveFirst
  4.         str = InputBox("What Name Can I Find For You......?", "Who Name Can I Search For You Today?")
  5.         Adodc1.Recordset.Find "lessorsname='" & str & "'"
  6. End Sub
But the problem is what if the name doesn't exist what Code can i use for this?

lee123
May 22 '09 #1
3 30720
debasisdas
8,127 Expert 4TB
what you want to return if the record does not exist ?
May 22 '09 #2
lee123
556 512MB
A msgbox that says " Sorry No Match"

lee123
May 22 '09 #3
QVeen72
1,445 Expert 1GB
Hi,

After FIND, Check EOF of the recordset..
Try this :

Expand|Select|Wrap|Line Numbers
  1. Private Sub mnuName_Click()
  2.    Dim str1 As String
  3.    Adodc1.Recordset.MoveFirst
  4.    str1 = InputBox("What Name Can I Find For You......?", "Who Name Can I Search For You Today?")
  5.   Adodc1.Recordset.Find "lessorsname='" & str1 & "'"
  6.  If Adodc1.Recordset.EOF Then
  7.      MsgBox "No Records Found... Try Again"
  8.  Else
  9.      MsgBox "Records Found"
  10.      ' Code To Populate Textboxes..
  11.  End If
  12. End Sub
  13.  
  14.  
Regards
Veena
May 26 '09 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Galsaba | last post by:
I am trying to find a script to a "dealer locator" or "find a store near you". I will have two tables. One will include all US and Canada ZIPs including lat and longtitudes. The other one is a...
3
by: Dmitry Jouravlev | last post by:
Hi, I have a number of C++ solutions in Visual Studio .NET and when i compile them using "Whole Program Optimization", certain projects report a LNK1171 error saying that c2.dll could not be...
2
by: Lenonardo | last post by:
Hi. I'm writing a VB.Net application to update multiple Excel Worksheets. I'm using late binding (i.e. all variables are objects + use createobject) I develop the application on an XP...
2
by: Ori :) | last post by:
I am writing an application to retrieve appointments from Outlook, I have the appointment items sorted by "Start" field and now I want to find the first record which's "Start" value is later than...
2
by: Bill nguyen | last post by:
How can I get a listbox to display the most closely matched items when user types in the first few letters/digits of displaymember value? Thanks a million Bill
4
by: jim | last post by:
I'm trying to import a 625MB, tab-delimited .txt file into Access, but I keep receiving the following error after several minutes of what seem to be noble attempts by Access to render the data: ...
0
by: Rave | last post by:
This is a long shot, but I thought I'd try it. I am currently using excel as an inventory tool. I currently have a hand-held scanner plugged into a laptop for reading barcodes. Using the "Find and...
2
by: Jeff Gardner | last post by:
Greetings: I've a script written for paging through a given recordset with page links, etc. I want to be able to limit the number of page numbers displayed as a large query may result in 100 or...
10
by: nspader | last post by:
I want to start out saying I am a novice code writer. I am trying to send a report via email based on each supplier. The code below is what I am using. I need to base recordset on Form, report...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.