4 Replies - 2853 Views - Last Post: 09 September 2010 - 08:18 AM Rate Topic: -----

#1 guyfromri   User is offline

  • D.I.C Addict

Reputation: 46
  • View blog
  • Posts: 836
  • Joined: 16-September 09

Method of Data Member not found

Posted 08 September 2010 - 10:05 AM

Hey guys, I can't figure this out for the life of me. I have a program that worked great then I added a few things to it and other pieces stopped working.

Option Compare Database

Dim RS As Recordset

Set RS = currentdb.openrecordset("Tbl")

LCount = RS.RecordCount ' Works
RS.MoveFirst ' Works
Do Until RS.EOF ' Works
MyVar=RS.Fields(1) ' NOT WORKING ---- I get the message that ".Fields" method or data memeber not found



Anyone have any ideas why this could happen? I've tried everything right down to changing the RS name and deleting the module and creating a new one (just in case) but I can't figure this out.



As always, thanks in advance!!

Is This A Good Question/Topic? 0
  • +

Replies To: Method of Data Member not found

#2 raziel_   User is offline

  • Like a lollipop
  • member icon

Reputation: 469
  • View blog
  • Posts: 4,280
  • Joined: 25-March 09

Re: Method of Data Member not found

Posted 08 September 2010 - 10:15 AM

can it be because of line 3:
Dim RS As Recordset

i think it must be
Dim RS As ADODB.Recordse

:)

This post has been edited by NoBrain: 08 September 2010 - 10:16 AM

Was This Post Helpful? 1
  • +
  • -

#3 guyfromri   User is offline

  • D.I.C Addict

Reputation: 46
  • View blog
  • Posts: 836
  • Joined: 16-September 09

Re: Method of Data Member not found

Posted 09 September 2010 - 06:20 AM

Thanks NoBrain!

The problem is that didn't work either. And the issue gets hairier...

I have roughly 10 forms in my program. They each run a separate program on different file types. In some of these, I used the same RS name and certain procedures. They have all worked but when the other problem came up, these stopped working as well. I also have a recordset name called RSDemo but those all still work......

I just don't get what I could have changed to make this issue.


Thanks for the help!
Was This Post Helpful? 0
  • +
  • -

#4 raziel_   User is offline

  • Like a lollipop
  • member icon

Reputation: 469
  • View blog
  • Posts: 4,280
  • Joined: 25-March 09

Re: Method of Data Member not found

Posted 09 September 2010 - 07:47 AM

yea my brain was kinda slow yesterday and did not think that this have nothing to do with your problem if the problem was in the declaration it should give you error there and not show you the error at .Fileds. so check if some reference is not removed. the problem is in .Fields line so check what properties(functions) your recordset have. perhaps your reference to the adodb is changed.
Was This Post Helpful? 1
  • +
  • -

#5 guyfromri   User is offline

  • D.I.C Addict

Reputation: 46
  • View blog
  • Posts: 836
  • Joined: 16-September 09

Re: Method of Data Member not found

Posted 09 September 2010 - 08:18 AM

:::SOLUTION:::


Thanks for the input....as it turns out, it was a stupid typo on my part. I made a change to a class module that threw off one of my public variables that was in a separate part of some of those lines and that variable(which turned in to date) was the error. I didn't notice it until coffee number 3 this morning.

I went through references and was going crazy until I finally noticed that.

Thanks NoBrain!!
Was This Post Helpful? 1
  • +
  • -

Page 1 of 1