发布网友 发布时间:2022-04-26 23:01
共1个回答
热心网友 时间:2022-06-19 15:52
Dim SQL as String
SQL="SELECT * FROM tbl"
Dim rs as DAO.Recordset
Set rs=CurrentDb.OpenRecordset(SQL,dbopendynaset)
'补上后面这行代码即可将记录集与窗体绑定
Set Me.chn.Form.Recordset=rs
其实DAO已经非常古老了。如果用下面的的代码将数据表与子窗体绑定将会更简便有效:
1
2
3
Private Sub Form_Open(Cancel As Integer)
Me.chn.Form.RecordSource = "SELECT * FROM tbl"
End Sub