473,396 Members | 1,996 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,396 software developers and data experts.

Recordset problems

Hi

I keep getting the error message "Compile Error: Method or data member
not found" when using the following code to open a recordset, the
".FindFirst" part is highlighted:

Dim rst As DAO.Recordset
Dim strSearchName As Integer
Dim db As DAO.Database

Set db = DBEngine(0)(0)
Set rst = db.OpenRecordset("SELECT SS_NP2.StoreRef, SS_NP2.URN From
SS_NP2 WHERE SS_NP2.storeref = " & Forms!frmMyForm![cboURN]

strSearchName = Me!cboURN
rst.FindFirst "StoreRef = " & strSearchName
rst.FindFirst
If rst.NoMatch Then
' MsgBox "Record not found"
Exit Sub
End If
rst.Close

All i want to do is exit the proc if the recordset returns no records.

Any ideas?
Thanks for any suggestions.
Paul

Jan 23 '07 #1
1 1525
pa************@hotmail.com wrote:
Hi

I keep getting the error message "Compile Error: Method or data member
not found" when using the following code to open a recordset, the
".FindFirst" part is highlighted:

Dim rst As DAO.Recordset
Dim strSearchName As Integer
Dim db As DAO.Database

Set db = DBEngine(0)(0)
Set rst = db.OpenRecordset("SELECT SS_NP2.StoreRef, SS_NP2.URN From
SS_NP2 WHERE SS_NP2.storeref = " & Forms!frmMyForm![cboURN]

strSearchName = Me!cboURN
rst.FindFirst "StoreRef = " & strSearchName
rst.FindFirst
Why do you have a second FindFirst?
If rst.NoMatch Then
' MsgBox "Record not found"
You might want to close the recordset and set it to nothing prior to
leaving the sub
Exit Sub
End If
rst.Close

All i want to do is exit the proc if the recordset returns no records.

Any ideas?
Thanks for any suggestions.
Paul
Jan 24 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

23
by: Rob Meade | last post by:
Lo all, Ok - this is what I was aiming to do, and then I thought - naahhh, that cant be right! query database results to recordset results to array using GetRows update values in one column...
1
by: ano1optimist | last post by:
Has anyone had success with using a command collection with parameters to run a stored procedure from sql server? I'm frustrated and have been spending way too much time trying to make this work. ...
0
by: CSDunn | last post by:
Hello, In Access ADP's that connect to SQL Server databases, any time I have a situation where I have a combo box in a main form that looks up a record in a subform, the subform record source has...
3
by: alex_peri | last post by:
Hello All, I am having problems with sorting a recordset by fields in Access. I have a table with three columns called ID, SNo and Time and would like to sort the records by Time. I would like to...
6
by: lenny | last post by:
Hi, I've been trying to use a Sub or Function in VBA to connect to a database, make a query and return the recordset that results from the query. The connection to the database and the query...
1
by: ora06 | last post by:
Hi everybody I am a newcomer in VC++ developement I work VC with Oracle database I want to manipulate the database with ADODB After connected , i do as follow: ------------------------...
7
by: marmottedodue | last post by:
Hello, I'm trying to debug an access project in which two kind of recordset are used: ADODB.recordset and DAO.recordset. I'm trying to set the whole project on DAO.recordset, but the following...
6
by: ZRexRider | last post by:
I've been reading the newsgroups and most of the solutions for this message are simple and obvious but unfortunately don't solve my problem. I have an MS-Access 2002 ADP application that...
6
by: Oko | last post by:
I'm currently developing an MS Access Data Project (.adp) in MS Access 2002. One of the reports within the DB uses data that is Dynamic and cannot be stored on the SQL Server. To resolve this, I...
2
by: MayoM | last post by:
The help on "Recordset Property" describes how you can bind a form to a recordset. I am trying to get this to work - in Access 2003 - in a subform - in the Form_Open event - assigning a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.