Private Sub Text2_Change()
Set recdst1 = New ADODB.Recordset
recdst1.ActiveConnection = CurrentProject.Connection
recdst1.CursorType = adOpenDynamic
recdst1.Open " Select * FROM 99规范列表 where [99规范列表].规范名称 like '*" & Text2.Value & "*'", , adOpenDynamic, adLockOptimistic
Set Me.Child75.Form.Recordset = recdst1
Child75.Form.Refresh
Child75.Form.Requery
recdst1.Close
Set recdst1 = Nothing
End Sub
程序运行到 “Set Me.Child75.Form.Recordset = recdst1” 一行
提示 运行时错误 ‘7965’
您输入的对象不是有效的 Recordset 属性。
请问是什么原因
用 access vba 编写的实时查询数据库并将结果显示在子窗口的程序
答案:2 悬赏:60 手机版
解决时间 2021-12-22 09:58
- 提问者网友:一抹荒凉废墟
- 2021-12-21 16:53
最佳答案
- 五星知识达人网友:长青诗
- 2021-12-21 18:10
如下即可:
Private Sub Text2_Change()
me.Child75.SourceObject="数据表.99规范列表"
with me.Child75.form
.Filter="规范名称 like '*" & Text2.Value & "*'"
.FilterOn = True
end with
End Sub
Private Sub Text2_Change()
me.Child75.SourceObject="数据表.99规范列表"
with me.Child75.form
.Filter="规范名称 like '*" & Text2.Value & "*'"
.FilterOn = True
end with
End Sub
全部回答
- 1楼网友:西岸风
- 2021-12-21 19:03
程序如下:
public sub open_access()
dim myaccess as access.application
set myaccess = getobject("d:\database1.accdb")
myaccess.visible = true
myaccess.docmd.opentable "sheet1"
myaccess.docmd.maximize
set myaccess = nothing
end sub
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯