不需要的输入参数值消息框

时间:2009-06-08 16:33:38

标签: ms-access

我有一个打开报告的按钮。我在“where”子句中有一个语句,只显示与当前表单中字段中的位置匹配的ToteLocation。这是代码:

Private Sub         
    cbTruckorder_Click()
    Dim stdocname As Stringstdocname = "TruckLoadingReport"
    ' setting focus to ScannerRead in order to continue operations 
    '      (see Command22)
    Me.tbScannerRead.SetFocus
    ' opening the Truck Loading Report
    DoCmd.OpenReport stdocname, acViewPreview, , "[Tote Log].ToteLocation =" & _
                                                            Me.tbScannerRead
End Sub

我收到一个询问参数值的消息框。在框中,它显示了Me.tbScannerRead的值。例如:T265。该报告非常简单,页面标题中有totelocation文本框,信息按批号分组,在批号标题中我有一个批号的文本框。我的细节我有手提包编号文本框,就是它,仅此而已。

如果我在参数值中输入值(T265),它将显示报告,但我需要参数值框消失,任何人的建议都会很好。

谢谢

以下是报告的SQL:

SELECT [Tote Log].Type, 
        [Tote Log].Number, 
        [Tote Log].ToteLocation, 
        [Lot Number].Lot
FROM [Tote Log] INNER JOIN [Lot Number] 
        ON [Tote Log].[Lot Number] = [Lot Number].ID;

1 个答案:

答案 0 :(得分:2)

Private Sub         
    cbTruckorder_Click()       
    Dim stdocname As Stringstdocname = "TruckLoadingReport"        
    ' setting focus to ScannerRead in order to continue operations 
    '     (see Command22) 
    Me.tbScannerRead.SetFocus   
    ' opening the Truck Loading Report 
    DoCmd.OpenReport stdocname, acViewPreview, , "[Tote Log].ToteLocation ='" & _
                                                        Me.tbScannerRead & "'" 
End Sub

我不记得他的姓,但谢谢杰夫,这真的很有帮助。我添加了单引号,但在ME.tbScannerRead之后取出了.text。再次感谢