尝试在访问表单上搜索并显示搜索结果以进行编辑。我是vba编程的新手,我只修改了与发布here类似的要求的代码。
当我在txtcISubjectID中输入搜索值时,我不断收到此错误消息。User-defined type not defined
我的代码:
`
If (txtcISubjectID & vbNullString) = vbNullString Then Exit Sub
Dim rs As DAO.Recordset
Set rs = Me.RecordsetClone
rs.FindFirst "[cISubjectID]=" & txtcISubjectID
If rs.NoMatch Then
MsgBox "Sorry, no such record '" & Me.txtcISubjectID & "' was found.", _
vbOKOnly + vbInformation
Else
Me.Recordset.Bookmark = rs.Bookmark
End If
rs.Close
txtcISubjectID = Null`
我在这里做错了什么?我参考了以下库:
Visual Basic for Application
OLE自动化
Microsoft Access 14.0对象库