我有一小段代码,嵌入到一个连续表单的按钮中。它将打开一个表单,提供搜索结果之外的其他详细信息。
我的问题是,似乎当所有详细信息都存在时,表单可以正确打开,如果缺少任何字段(比如支付日期或代金券号码),表单就会空白打开?
以下是搜索查询的代码,以及用于打开表单的按钮的代码:
Private Sub Command1_Click()
Dim strsearch As String
Dim strText As String
strText = Me.txtSearch.Value
strsearch = "Select * from tblInvoiceLog where Vendor_Number like ""*" & strText & "*"" or Vendor_Name like ""*" & strText & "*"" or Invoice_1 like ""*" & strText & "*"" or Invoice_2 like ""*" & strText & "*"" or Invoice_3 like ""*" & strText & "*"" or Invoice_4 like ""*" & strText & "*"" or Invoice_5 like ""*" & strText & "*"" or Check_Request_Total like ""*" & strText & "*"" or Voucher_Number like ""*" & strText & "*"" or Notes like ""*" & strText & "*"" or TransAction_Id like ""*" & strText & "*"" ORDER BY [Pay_Date] DESC"
Me.RecordSource = strsearch
End Sub
Private Sub Command53_Click()
DoCmd.OpenForm "frm: Check Request Info (Redesign)", , , "TransAction_Id = " & TransAction_ID
End Sub我想我已经解决了这个方程式中的所有变量?有没有人能提个建议?
发布于 2015-12-23 02:40:51
在使用多个窗体/子窗体时,请确保您的记录源都指向相同的表/查询。当然是一个新手的答案/问题,但它可以省去头痛的麻烦谢谢你韦恩·G·邓恩
https://stackoverflow.com/questions/34336463
复制相似问题