T
Tony Schlak
Private Sub DoPrintOut(nMethod As Integer)
Dim strWC As String
On Error GoTo Err_DoPrintOut
If Not IsNull(Me.Admin_Name) Then
strWC = " AdminID = " & Me.Admin_Name & ""
End If
If Not IsNull(Me.Prof_Name) Then
If strWC = "" Then
strWC = "Professor = " & Me.Prof_Name & ""
Else
strWC = strWC & " And Professor = " & Me.Prof_Name & ""
End If
End If
If Not IsNull(Me.Doc_Type) Then
If strWC = "" Then
strWC = "DocTypeID = " & Me.Doc_Type & ""
Else
strWC = strWC & " And DocTypeID = " & Me.Doc_Type & ""
End If
End If
If Not IsNull(Me.cmbOther) Then
If strWC = "" Then
strWC = "Other_RequestorID = " & Me.cmbOther & ""
Else
strWC = strWC & " And Other_RequestorID = " & Me.cmbOther & ""
End If
End If
If Not IsNull(Me.cboAccount) Then
If strWC = "" Then
strWC = "Acct_Number = " & Me.cboAccount & ""
Else
strWC = strWC & " And Acct_Number = " & Me.cboAccount & ""
End If
End If
If Not IsNull(Me.cboStart And Me.cboEnd) Then
If strWC = "" Then
strWC = "OrderID = (>" & Me.cboStart & " and <" & Me.cboEnd &
")"
Else
strWC = strWC & " And OrderId = (>" & Me.cboStart & " and <" &
Me.cboEnd & ")"
End If
End If
DoCmd.OpenReport strReport, nMethod, , strWC
'DoCmd.Close acForm, Me.Name
Exit_DoPrintOut:
Exit Sub
Err_DoPrintOut:
MsgBox Err.Description
Resume Exit_DoPrintOut
End Sub
Here is the code used to generate a preivew of the report called. All work
but the cboStart and cboEnd. All values are integers. When strWC returns a
value for the cbo's it is OrderID = (>1173 and <1291) and then returns a
Syntax error (missing operator) in query .... Any sugeestions??
Thanks,
Tony
Dim strWC As String
On Error GoTo Err_DoPrintOut
If Not IsNull(Me.Admin_Name) Then
strWC = " AdminID = " & Me.Admin_Name & ""
End If
If Not IsNull(Me.Prof_Name) Then
If strWC = "" Then
strWC = "Professor = " & Me.Prof_Name & ""
Else
strWC = strWC & " And Professor = " & Me.Prof_Name & ""
End If
End If
If Not IsNull(Me.Doc_Type) Then
If strWC = "" Then
strWC = "DocTypeID = " & Me.Doc_Type & ""
Else
strWC = strWC & " And DocTypeID = " & Me.Doc_Type & ""
End If
End If
If Not IsNull(Me.cmbOther) Then
If strWC = "" Then
strWC = "Other_RequestorID = " & Me.cmbOther & ""
Else
strWC = strWC & " And Other_RequestorID = " & Me.cmbOther & ""
End If
End If
If Not IsNull(Me.cboAccount) Then
If strWC = "" Then
strWC = "Acct_Number = " & Me.cboAccount & ""
Else
strWC = strWC & " And Acct_Number = " & Me.cboAccount & ""
End If
End If
If Not IsNull(Me.cboStart And Me.cboEnd) Then
If strWC = "" Then
strWC = "OrderID = (>" & Me.cboStart & " and <" & Me.cboEnd &
")"
Else
strWC = strWC & " And OrderId = (>" & Me.cboStart & " and <" &
Me.cboEnd & ")"
End If
End If
DoCmd.OpenReport strReport, nMethod, , strWC
'DoCmd.Close acForm, Me.Name
Exit_DoPrintOut:
Exit Sub
Err_DoPrintOut:
MsgBox Err.Description
Resume Exit_DoPrintOut
End Sub
Here is the code used to generate a preivew of the report called. All work
but the cboStart and cboEnd. All values are integers. When strWC returns a
value for the cbo's it is OrderID = (>1173 and <1291) and then returns a
Syntax error (missing operator) in query .... Any sugeestions??
Thanks,
Tony