创建一个查询,sql语法为方括号内的文本【select * from 产品 where 供应商id in(SELECT 供应商id from 供应商 where 选择=true)】,并保存命名为【查询1】,然后按钮的代码:
Private Sub 查询_Click()
'Dim sql As String
'sql = "select * from 产品 where 供应商id in(SELECT 供应商id from 供应商 where 选择=true)"
Me.产品.SourceObject = "查询.查询1"
End Sub