473,326 Members | 2,102 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Runtime Error 3265

I'm not sure why I'm getting this error. When I look at my locals window, I can see item "rs", which has fields Container and Expr1001. Here's the code:
Expand|Select|Wrap|Line Numbers
  1. Private Sub Command8_Click()
  2.  
  3. Dim strWhatTable As String
  4. Dim dbs As Database
  5. Dim rs As Recordset
  6. Dim intAllContainers As Integer
  7.  
  8. strWhatTable = Me.Combo1
  9.  
  10. Set dbs = OpenDatabase("C:\Data_Process\Data_Process.mdb")
  11.  
  12. With dbs
  13.     strSQL = "Delete From Container_Count"
  14.     .Execute strSQL
  15. End With
  16.  
  17. With dbs
  18.     strSQL = "Insert INTO Container_Count Select Container, Count(*) as Expr1001 from " + strWhatTable + " Group by Container"
  19.     .Execute strSQL
  20. End With
  21.  
  22. Set rs = dbs.OpenRecordset("SELECT Container, Expr1001 FROM Container_Count")
  23.  
  24. rs.MoveLast
  25. intAllContainers = rs(Container) ' Error happens here
  26. rs.MoveFirst
  27.  
  28. End Sub
Sep 7 '07 #1
2 3329
JKing
1,206 Expert 1GB
Try changing the offending line to this:

Expand|Select|Wrap|Line Numbers
  1. intAllContainers = rs("Container")
  2.  
Sep 7 '07 #2
Thanks. It's always the simple things.
Sep 7 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Sivasenthil | last post by:
With the Runtime error above , I get the following message" Item cannot be found in the collection corresponding to the requested name or ordinal" Is this application specific or a common VB...
0
by: rajkalacbe | last post by:
I am running a visual basic executable program through Forms4.5 of D2K using Forms menu options.. When I Invoke this form in the server where I have the database installed, I do not have any...
6
by: darkhat01 | last post by:
I am getting a Run-Time error '3265': Item cannot be found in the collection corresponding to the requested name or ordinal. The Function call I am using is: ...
1
by: wassimdaccache | last post by:
Hello Please help me I working on database using access 2003 I'm writing into a save bottom on a form this code to insert some of my value on another table ...no relationship between them ...
1
by: thejad | last post by:
Hi, I looked up all I could read up on the error, and still can't make heads or tails of what I am doing wrong. My goal is to be able to update a series of fields for a specific record using...
2
by: marcohod | last post by:
Hi, I'm using ADO 2.8 in VB6 to use an SQL Server 2000 database. This works: Dim MyRS2 As New ADODB.Recordset MySQL = "Select * from table1" MyRS2.Open MySQL, sqlConnection,...
3
by: DGNinja12 | last post by:
I get this error when i run, i cant figure out what is wrong Can some one please help me? Run-time error '3265': Item cannot be found in the collection corresponding to the requested name or...
0
nurikoAnna
by: nurikoAnna | last post by:
Dim rsFaculty As New ADODB.Recordset Dim rsDepartment As New ADODB.Recordset Dim oCm As New ADODB.Command Private Sub Disconnect() connect.Close End Sub
8
by: charli | last post by:
Error 3265, "Item cannot be found in the collection corresponding to the requested name or ordinal" code programatically opens a query using ADOX and changed the sql Dim cat As New...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.