|
7#
楼主 |
发表于 2009-3-28 15:59:33
|
只看该作者
Private Sub Com1()
Dim strWhere As String
strWhere = ""
If Not IsNull(Me.水分上线) Then strWhere = strWhere & "([VarValue] <= " & Me.水分上线 & ") AND "
If Not IsNull(Me.水分下线) Then strWhere = strWhere & "([VarValue] >= " & Me.水分下线 & ") AND "
If Len(strWhere) > 0 Then
strWhere = Left(strWhere, Len(strWhere) - 5)
End If
Me.水分.Form.Filter = strWhere
Me.水分.Form.FilterOn = True
End Sub
Private Sub Com2()
Dim str2 As String
str2 = ""
If Not IsNull(Me.水分上线) Then str2 = str2 & "([VarValue] > " & Me.水分上线 & ") OR "
If Not IsNull(Me.水分下线) Then str2 = str2 & "([VarValue] < " & Me.水分下线 & ") OR "
If Len(str2) > 0 Then
str2 = Left(str2, Len(str2) - 4)
End If
Me.不合格水分.Form.Filter = str2
Me.不合格水分.Form.FilterOn = True
End Sub
Private Sub Command14_Click()
Me.起始时间 = Null
Me.截止时间 = Null
Me.水分上线 = Null
Me.水分下线 = Null
Call Com1
Call Com2
Me.水分.Requery
Me.不合格水分.Requery
Me.起始时间.SetFocus
End Sub
Private Sub Command73_Click()
Frame54 = 1
Dim stDocName, strWhere As String
stDocName = "水分合格表"
strWhere = Me.水分.Form.Filter
DoCmd.OpenReport stDocName, acPreview, , strWhere
Frame54 = 2
Dim stDocName, strWhere As String
stDocName = "水分不合格表"
strWhere = Me.水分.Form.Filter
DoCmd.OpenReport stDocName, acPreview, , strWhere
Frame54 = 3
Dim stDocName, strWhere As String
stDocName = "水分汇总表"
strWhere = Me.水分.Form.Filter
DoCmd.OpenReport stDocName, acPreview, , strWhere
Exit_Command73_Click:
Exit Sub
Err_Command73_Click:
MsgBox Err.Description
Resume Exit_Command73_Click |
|