Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
|
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 25th, 2006, 03:34 PM
Registered User
 
Join Date: May 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default FindFirst: Method or data meber not found

For some reason I can't access the FindFirst property of the recordset:

Private Sub cbWeek_AfterUpdate()

    Dim var As Variant

    var = DLookup("[id]", "Activity_Log", "[StudyID] = " & Me.cbStudyID.Value & " AND [Week] = " & Me.cbWeek.Value)

   Dim rs As ADODB.Recordset

   Set rs = Me.Recordset.Clone

   ' ERROR
   rs.FindFirst "[id] = " & var

End Sub




 
Old May 25th, 2006, 03:59 PM
Registered User
 
Join Date: May 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Ok, I've added the DAO 3.6 library and tried the following code again:


Private Sub cbWeek_AfterUpdate()

    Dim var As Variant

    var = DLookup("[id]", "Activity_Log", "[StudyID] = " & Me.cbStudyID.Value & " AND [Week] = " & Me.cbWeek.Value)

    Dim rs As DAO.Recordset

    Set rs = Me.RecordsetClone

    rs.FindFirst "[id] = " + var


End Sub



... but now I keep getting a type mismatch error on the line "Set rs = Me.RecordsetClone"


 
Old May 26th, 2006, 11:05 AM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 217
Thanks: 0
Thanked 1 Time in 1 Post
Default

Welcome to P2P!

A few ideas to look at:
1)What is the datatype of cbStudyID.value? (string or numeric?)
2) What is datatype of cbWeek.value? (string or numeric?)
3) If your variable var is a string, what happens when you try
rs.findfirst "[id] = '" & var & "'" '?






Similar Threads
Thread Thread Starter Forum Replies Last Post
no route found "/\\look\\at" with {:method=>:get} cazalot BOOK: Beginning Ruby on Rails 2 January 3rd, 2008 07:27 AM
complile error : method or data member not found! Tasha Access VBA 6 May 1st, 2007 03:49 PM
Method or Data Member not Found Related to Crystal ishqvj Beginning VB 6 0 November 29th, 2006 03:49 AM
Method or data member not found Subuana Beginning VB 6 1 March 6th, 2006 03:32 PM
Method or Data member not found Anup Gavate VB How-To 2 March 25th, 2005 04:50 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.