我想通过单击基于三个不同组合框(即客户类型、客户名称和现金票据编号。我创建了下面给出的代码并收到错误......请帮助。
代码:DoCmd.OpenReport "Invoice", acViewReport, , "[客户类型] = " & Me.ltyp 和 [客户姓名] = " & Me.lcnm 和 [现金凭证/税务发票编号] = " & Me .lmnum, acWindowNormal"
DoCmd.OpenReport "发票", acViewReport, , "[客户类型] = " & Me.ltyp 和 [客户姓名] = " & Me.lcnm 和 [现金凭证/税务发票编号] = " & Me.lmnum , acWindowNormal"
请解决我的问题。
您的代码错误。您必须区分文本和数字。假设[客户类型]和[客户姓名]是文本,[现金凭证/税务发票号码]是数字,它应该看起来像这样:
DoCmd.OpenReport "Invoice", acViewReport, , "[Customer Type] = '" & Me.ltyp & "' and [Name of the Customer] = '" & Me.lcnm & "' And [Cash Memo/Tax Invoice Number] = " & Me.lmnum, acWindowNormal
文本必须始终用引号引起来,数字则不必。