搞定了,通过煮江品茶 老师的指点一下,终于解决,原来是自己粗心,控件名称错了个字母,晕S。。
Private Sub Command51_Click()
Dim Str As String
Str = "true"
'入库、出库日期条件查询
If Not IsNull(FG_IN_DATE) Then
Str = Str & " and 入库日期>=#" & FG_IN_DATE & "#"
End If
If Not IsNull(Text43) Then
Str = Str & " and 入库日期<=#" & Text43 & "#"
End If
If Not IsNull(FG_OUT_DATE) Then
Str = Str & " and 出库日期>=#" & FG_OUT_DATE & "#"
End If
If Not IsNull(Text47) Then
Str = Str & " and 出库日期<=#" & Text47 & "#"
End If
'入库单出库单条件查询
If Not IsNull(FG_IN_SLIP) Then
Str = Str & " and 入库单号>= " & Me.FG_IN_SLIP & ""
End If
If Not IsNull(Text45) Then
Str = Str & " and 入库单号<=" & Text45 & ""
End If
If Not IsNull(FG_OUT_SLIP) Then
Str = Str & " and 出库单号>=" & Me.FG_OUT_SLIP & ""
End If
If Not IsNull(Text49) Then
Str = Str & " and 出库单号<=" & Text49 & ""
End If
If Len(Str) > 0 Then
Me.F_Pro_In_OutWindow.SourceObject = "F_Pro_In_OutWindow"
End If
Me.F_Pro_In_OutWindow.Form.FilterOn = True
Me.F_Pro_In_OutWindow.Form.Filter = Str
End Sub