|
我用下面这句怎么处理不了啊!
Dim rs As New ADODB.Recordset
Dim ssSql As String
ssSql = "Select id,货品名称,货品代号,货品颜色,货品尺码,进货数量,进货价格,进货日期,备注 from 进货明细 where 货品名称='裤子'"
Set rs = conn.Execute(ssSql)
Me.进货数据.Form.RecordSource = rs
总提示类型不匹配。哪位大哥指导一下啊!
我估计你是用ADO的记录集作为子窗体的数据源,如果是只读,你应该这样写:- Dim rs As ADODB.Recordset
- Dim ssSql As String
- ssSql = "Select id,货品名称,货品代号,货品颜色,货品尺码,进货数量,进货价格,进货日期,备注 from 进货明细 where 货品名称='裤子'"
- Set rs = conn.Execute(ssSql)
- Set Me.进货数据.Form.Recordset = rs
复制代码 如果是要可以修改和删除,你应该这样写:- Dim rs As New ADODB.Recordset
- Dim ssSql As String
- ssSql = "Select id,货品名称,货品代号,货品颜色,货品尺码,进货数量,进货价格,进货日期,备注 from 进货明细 where 货品名称='裤子'"
- rs.Open ssSql, conn, 1, 3
- Set Me.进货数据.Form.Recordset = rs
复制代码 |
|