目前我正在使用从excel导入外部数据的Access工作。当我试图超出该值时,我获得无效或不合格的参考。
Excel表格中可用的列: -
以下是我到目前为止尝试的代码: -
qry = "SELECT * FROM " & _
"tbl_mainframe "
Set rst = CurrentDb.OpenRecordset(qry)
rst.MoveLast
total_record = rst.RecordCount
rst.MoveFirst
For i = 0 To total_record - 1
MsgBox (Nz(!Card_Number)) - > **Error**
rst.MoveNext
Next i
rst.Close
请告知。
答案 0 :(得分:1)
这应该有效
qry = "SELECT * FROM tbl_mainframe"
Set rst = CurrentDb.OpenRecordset(qry)
do While not rst.Eof
MsgBox (Nz(rst!Card_Number))
rst.MoveNext
Loop
rst.Close