By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,124 Members | 2,027 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,124 IT Pros & Developers. It's quick & easy.

Runtime Error 3265

P: 80
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
Share this Question
Share on Google+
2 Replies


JKing
Expert 100+
P: 1,206
Try changing the offending line to this:

Expand|Select|Wrap|Line Numbers
  1. intAllContainers = rs("Container")
  2.  
Sep 7 '07 #2

P: 80
Thanks. It's always the simple things.
Sep 7 '07 #3

Post your reply

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