 |
| 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
|
|
|
|

May 4th, 2009, 03:07 PM
|
|
Authorized User
|
|
Join Date: Oct 2003
Posts: 25
Thanks: 1
Thanked 0 Times in 0 Posts
|
|
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
|
|

May 4th, 2009, 05:14 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
|
|
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.
================================================== =========
|
|

May 4th, 2009, 07:12 PM
|
|
Authorized User
|
|
Join Date: Oct 2003
Posts: 25
Thanks: 1
Thanked 0 Times in 0 Posts
|
|
Sorry, I left it out when I posted the message. My bad.
|
|

May 4th, 2009, 09:24 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
|
|
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.
================================================== =========
|
|

May 5th, 2009, 09:36 AM
|
|
Authorized User
|
|
Join Date: Oct 2003
Posts: 25
Thanks: 1
Thanked 0 Times in 0 Posts
|
|
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
|
|

May 5th, 2009, 11:24 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
|
|
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.
================================================== =========
|
|

May 5th, 2009, 05:05 PM
|
|
Authorized User
|
|
Join Date: Oct 2003
Posts: 25
Thanks: 1
Thanked 0 Times in 0 Posts
|
|
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
|
|

May 5th, 2009, 05:50 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
|
|
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:
|
|
|
 |