Dim mydrawing As String
mydrawing = "select * from tbl_welddata where([Drawingno] = " & Me!CboDrawingno & ")"
Me.tbl_welddatasubform.Form.RecordSource = mydrawing Me.tbl_welddatasubform.Form.Requery
我收到一条错误消息;
数据类型不匹配错误3464
每次调试时都指向此行
Me.tbl_welddatasubform.Form.RecordSource = mydrawing
有人可以帮我排序吗?
答案 0 :(得分:0)
放入调试行,然后研究输出:
Dim mydrawing As String
mydrawing = "select * from tbl_welddata where([Drawingno] = " & Me!CboDrawingno & ")"
' If text, quotes are needed:
' mydrawing = "select * from tbl_welddata where([Drawingno] = '" & Me!CboDrawingno & "')"
Debug.Print mydrawing
Me!tbl_welddatasubform.Form.RecordSource = mydrawing
不需要重新查询。
您可以手动应用生成的 mydrawing 吗?
Drawingno 是数字,不是文本吗?
tbl_welddatasubform 是子表单 control 的名称吗?