Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA 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 July 7th, 2006, 11:20 AM
Registered User
Join Date: Jul 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Compile Error data member not found

Hello All,

Pls help i get this error : Compile error data member not found

Private Sub btnPostEntry_Click()
Dim db As Database, rs As Recordset, sqltxt As String
Set db = DBEngine(0)(0)

'sqltxt = "select * from STOCK_table where STOCK_table.[STORESCODE] = & Me![STORESCODE]"
'debug_added this code
sqltxt = "select * from STOCK_table where STOCK_table.[STORESCODE] = " & Me![STORESCODE] & ";"

'debug_added this code for debugging
MsgBox sqltxt
Set rs = db.OpenRecordset(sqltxt)
'Set rs = db.OpenRecordset(sqltxt, dbOpenDynaset)

If Not rs.EOF Then

    'Advise operator how much inventory left if getting close to 0
    If rs("ONHAND") = 0 Then
        MsgBox "Your inventory is at zero"
    End If

    'commented this out
    'rs("ONHAND") = rs("ONHAND") - Me![QUANTITY]
End If


Me!btnPostEntry.Visible = False

End Sub

Old July 7th, 2006, 05:35 PM
Registered User
Join Date: Jul 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts

I have been able to fix the error.

I just needed to define my rs as a DAO.recordset set.

Similar Threads
Thread Thread Starter Forum Replies Last Post
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
LoadFrom Invoke Member... Method not found DolphinBay VB.NET 2002/2003 Basics 1 April 29th, 2004 10:01 AM

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