Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Member or data member not found 1

Status
Not open for further replies.

Trudye

Programmer
Sep 4, 2001
932
US
I am getting a msg when I attempt to compile Access 2000. Originally the database would not save (ie save failed). I decided to move all the components to a new database and see if the problem persist. After the move I clicked save and everything was ok.

Then I decided to compile my modules. On the first compile I received msg: “Method or data member not found”. The highlighted code was a ".FindFirst" command. I went into references and added MS ADO 2.1.

On the second compile I received msg:Member or data member not found. The highlighted code was "Me!Sc_id".

This code has been working for almost a year. Not to drag this out but my MS Access has been doing quirky things all week. For instance: one night help (f1) stopped working, the next night the link table wizard could not be found and I was unable to reload it. And now this! I'm thinking of having the darn system EXORCISED!

Does anyone have any ideas?

Thanks
Trudye

OBTW, I am not using classes
 
i'm sorry I jumped the gun on this one. I had been looking for the msg at MS knowledge Base but was unable to find it, because I was looking under the wrong category.

The problem is my code does not fit their explaination. I do not have any class modules. Their solution does not work for me.

I will continue to look and see if I can find anything else on MS's DB.

Thanks
Trudye
 
Again I had to call MS. I exhausted their Knowledge Base and could find no adequate answers. They want to charge me $245.00 for the bug in their system and the inadequate presentation in their Knowledge Base. But I’ll fight that battle later, let me pass on to you what they imparted to me. So you won’t have to pay for a MS bug.

Open any module, on the Menu Bar click View;Object Browser. In the window below the window that contains <All Libraries> type the command you are having a problem with (i.e. Findfirst) and hit enter.

The library that contains your command/member will display. In my case the library was DAO, now here is the rub. I had DAO listed in my selected reference libraries, but it was positioned to low. Here is how you address that problem:
Remain in the module and on the Menu bar Click Tools;References. When the dialog box appears to the right of the listed libraries you will see Priority arrows. Move the necessary library to the top. In my case I just had to move the DAO library ahead of the ADO libraries.

The bottom line here is that the Findfirst member is in the DAO library but once the system hits the ADO library and does not find the member it issues the msg: method or data member not found.

I hope this will help programmers that encounter this problem in the future.

Trudye
 
Trudye

Glad to hear you found a solution. Just a quick question if you don't mind answering.

When dimensioned your Database and Recordset variables did you use &quot;Dim dbSample as Database&quot; or &quot;Dim dbSample as DAO.Database&quot; / &quot;Dim dbSample as ADO.Database&quot; etc ?
I'm just curious if defining the library with in the variable dimensioning would have also worked for you ?
 
Hi Trudye

Just a follow up:

Sample1 below produced the &quot;Member or data member not found&quot; error message when I included both ADO and DAO references in the module. Sample2 below resolved the problem.

I am just pointing out (assumming that both references are required) that while switching the position / order of the libraries in the list may solve the problem for any code using ADO, it may then create problems for any code making use of the DAO reference.
Looks like by including the intended reference with in the dimensioning of the variables is another alternative and one that may allow the two to coexist.


Sub Sample1()
Dim dbSample As Database
Dim rsSample As Recordset
Set dbSample = CurrentDb
Set rsSample = dbSample.OpenRecordset(&quot;AcctTable&quot;, dbOpenDynaset)
rsSample.FindFirst &quot;Age = &quot; & 23
MsgBox rsSample.Fields(2).Value
End Sub

Sub Sample2()
Dim dbSample As DAO.Database
Dim rsSample As DAO.Recordset
Set dbSample = CurrentDb
Set rsSample = dbSample.OpenRecordset(&quot;AcctTable&quot;, dbOpenDynaset)
rsSample.FindFirst &quot;Age = &quot; & 23
MsgBox rsSample.Fields(2).Value
End Sub
 
Hey Kevin:

That's an interesting approach, you learn something new everyday.

TO answer your question no I did not do that, actually that approach never occured to me. It would be ideal if MS would solve this problem once and for all.

Thanks for the great feedback, I will file this one away for future use.

Trudye
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top