我正在努力让这段代码在MS Access中运行:
Private Sub BtnIssue_Click()
Dim db As Database
Dim rec As Recordset
Set db = CurrentDb
Set rec = db.OpenRecordset("Select * from Current_Rentals")
rec.AddNew
rec("Game") = Me.Text85
rec("Game_Copy") = Me.Text77
rec("Member") = Me.Combo111
rec("Issue_Date") = Me.Text154
rec.Update
Set rec = Nothing
Set db = Nothing
End Sub
问题是Access抱怨编译错误,"用户定义的类型未定义" 。
答案 0 :(得分:1)
Dim rec as dao.recordset
Set rec = db.openrecordset("current_rentals",dbopendynaset)