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 May 4th, 2009, 03:07 PM
Authorized User
 
Join Date: Oct 2003
Posts: 25
Thanks: 1
Thanked 0 Times in 0 Posts
Default Compile Error: Method or data member not found

I am opening a recordset using the following code

Set dbs=openDatabase"G:\Database\GPManager\GPManagerDa ta.mdb")
Set rstA = dbs.OpenRecordset("tblLineItem", dbOpenDynaset)
rstA.Index = "InvoiceNumber"
rstA.Seek "=", Val(strSearch)
rstA.MoveFirst
vRate = rstA.LineRate

When I run the code, I get a Compile Error. Method or Data member not found. I know the spelling is correct and there is data in the table. What am I missing?

Thanks ... Ray
 
Old May 4th, 2009, 05:14 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

There is a missing ( in open database.. is that the error??
__________________
HTH

Gonzalo


================================================== =========
Read this if you want to know how to get a correct reply for your question.
(Took that from Doug signature and he Took that from Peter profile)
================================================== =========
My programs achieved a new certification :
WORKS ON MY MACHINE
================================================== =========
I know that CVS was evil, and now i got the
proof.
================================================== =========
 
Old May 4th, 2009, 07:12 PM
Authorized User
 
Join Date: Oct 2003
Posts: 25
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Sorry, I left it out when I posted the message. My bad.
 
Old May 4th, 2009, 09:24 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

if this rstA.LineRate is a field name, shouldn't be writed as rstA!LineRate ???
__________________
HTH

Gonzalo


================================================== =========
Read this if you want to know how to get a correct reply for your question.
(Took that from Doug signature and he Took that from Peter profile)
================================================== =========
My programs achieved a new certification :
WORKS ON MY MACHINE
================================================== =========
I know that CVS was evil, and now i got the
proof.
================================================== =========
 
Old May 5th, 2009, 09:36 AM
Authorized User
 
Join Date: Oct 2003
Posts: 25
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Thanks, that was the answer. In the past, I have always the dot instead of the bang and it always worked. I would like to know what the difference was, this time.

Ray
 
Old May 5th, 2009, 11:24 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

I really don't know. You should always use ! when you referenced a field...

Maybe you was using rs.item(nameoffield)??? (And I'm not even sure that's the correct property to get a field)
__________________
HTH

Gonzalo


================================================== =========
Read this if you want to know how to get a correct reply for your question.
(Took that from Doug signature and he Took that from Peter profile)
================================================== =========
My programs achieved a new certification :
WORKS ON MY MACHINE
================================================== =========
I know that CVS was evil, and now i got the
proof.
================================================== =========
 
Old May 5th, 2009, 05:05 PM
Authorized User
 
Join Date: Oct 2003
Posts: 25
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Sorry, you are very correct. I'm not sure what I was thinking this morning. It must have been a senior moment. After I made my changes, I took a look at previously written code and found that I always used the bang and not the dot. I think I've working on this project too long. Anyway, many thanks, I'll sleep well tonight.

Ray
 
Old May 5th, 2009, 05:50 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

Glad I help you out. Thanks buttons are on the bottom right ;)
__________________
HTH

Gonzalo


================================================== =========
Read this if you want to know how to get a correct reply for your question.
(Took that from Doug signature and he Took that from Peter profile)
================================================== =========
My programs achieved a new certification :
WORKS ON MY MACHINE
================================================== =========
I know that CVS was evil, and now i got the
proof.
================================================== =========
The Following User Says Thank You to gbianchi For This Useful Post:
RayL (May 5th, 2009)





Similar Threads
Thread Thread Starter Forum Replies Last Post
Compile error - method or data member not found ultimo01 Access VBA 4 January 14th, 2009 09:43 AM
complile error : method or data member not found! Tasha Access VBA 6 May 1st, 2007 03:49 PM
Compile Error data member not found alfiee Access VBA 1 July 7th, 2006 05:35 PM
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.