我不断收到运行时错误“3265”:
rstAnswers("20GBRank") = irank 在此集合中找不到项目,而它在其他数据库中工作。
我究竟做错了什么?我该如何解决?
Option Compare Database
Option Explicit
Public Function Update20BldgRank()
Dim db As Database
Dim rstAnswers As Recordset
Dim i As Integer
Dim irank As Integer
irank = 1
Set db = CurrentDb()
Set rstAnswers = db.OpenRecordset("Top20Genbld13", dbOpenDynaset)
rstAnswers.MoveFirst
Do Until rstAnswers.EOF
rstAnswers.Edit
rstAnswers("20GBRank") = irank
rstAnswers.Update
rstAnswers.MoveNext
irank = irank + 1
Loop
rstAnswers.Close
Update20BldgRank = irank - 1
End Function