Enabling .Count method

  • Thread starter Thread starter maxifire
  • Start date Start date
M

maxifire

Hi guys,

I was going through with this code when I encountered some error
stating that the method does not exist.

Sub Form_Load()
Set myDb = OpenDatabase("", 0, FALSE,_
"ODBC;DATABASE=findev;DSN=findev;")
Set myRs = OpenRecordset(_
"SELECT Table_Name FROM USER_TABLES "_
& "ORDER BY 1",_
dbForwardOnly)
If (Not myRs.EOF) Then
Dim cnt As Integer
For cnt = 0 To myRs.Count - 1
AllTables.AddItem myRs(0).Value
myRs.MoveNext
Next cnt
Else
End Sub

I've noticed that the line 'For cnt = 0 To myRs.Count - 1' is th
culprit to the problem.

My VBA program does not have the '.Count' method available. What can
do to make it available?

I'm a newbie, please accept my apology if I'm asking a stupi
question.

Thanks.


Regards,
Kennet
 
maxifire wrote
My VBA program does not have the '.Count' method available. What can I
do to make it available?

I use this line in one of my routines. While someone else may address your
specific routine, it may point you in the right direction.

If Application.WorksheetFunction.Count(Range("I:I")) <> 3 Then
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top