1

我不断收到运行时错误“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
4

1 回答 1

2

只需确保字段(列)20GRank存在于您收到错误的数据库中。

于 2013-04-01T17:51:33.823 回答