Sub 销售查询_单位()
Dim answer As String
answer = InputBox(Prompt:="请输入单位")
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "销售合同表"
stLinkCriteria = "[销售单位]=" & "'" & answer & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
End Sub作者: zhengjialon 时间: 2004-4-14 16:12
其中一句改成:stLinkCriteria = "[销售单位] like " & "'*" & answer & "*'",试试,没测过 作者: wdlyd 时间: 2004-4-14 22:05
不行~~系统说找不到宏 销售单位=like " & "'*" & [] & "*'",作者: 我同意 时间: 2004-4-15 01:13 标题: 看看我的例子,不知能否提供一个思路 [attach]4243[/attach]作者: wdlyd 时间: 2004-4-15 05:19
Sub GetInfo()
Dim answer As String
answer = InputBox(Prompt:="输入")
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "销售合同表"
stLinkCriteria = "SELECT 销售单位 FROM [销售合同表] WHERE [销售合同表].[销售单位] Like " * " & answer & " * ""
DoCmd.OpenForm stDocName, , , stLinkCriteria
End Sub
提示我“错误13,类型不匹配”
请问是什么不匹配,如何修改?作者: sea.er 时间: 2004-4-15 05:56
stLinkCriteria = "SELECT 销售单位 FROM [销售合同表] WHERE [销售合同表].[销售单位] Like '*" & answer & "*'"