修改原查询与利用查询创建新查询
时间:2021-09-02 06:00:54
收藏:0
阅读:7
‘查询1=“Select * from 表1 where 性别=‘男‘”
Sub 修改查询1()
SQL = "select * from 表1 where 性别=‘女‘"
CurrentDb.QueryDefs("查询1").SQL = SQL
End Sub
Sub 在查询1的基础上创建查询2()
SQL = "select * from 查询1 where 班级=‘1班‘"
Set 创建查询 = CurrentDb.CreateQueryDef("查询2", SQL)
Access.Application.RefreshDatabaseWindow
End Sub
来源:B站 孙兴华 ACCESS VBA 查询篇
原文:https://www.cnblogs.com/ondm/p/15207674.html
评论(0)