Results 1 to 2 of 2
  1. #1
    5 Star Lounger
    Join Date
    Jan 2001
    Posts
    1,119
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Odd Report Behavior (2003)

    I have a form that has a command button that prints the record that is on the screen. I use the following code behind the button:
    Private Sub cmdPrint_Click()
    On Error GoTo ErrHandler
    DoCmd.OpenReport "Report for Rep Search5", acViewPreview, , "SFId = " & Me.SFID
    Exit Sub

    ErrHandler:
    If Err = 2501 Then
    'cancelled - ignore
    Else
    MsgBox Err.Description, vbExclamation
    End If

    End Sub

    There is a field on the form called "Cancelled" with a dropdown list that has a "Y" as the only choice so it is either blank or "Y" for yes it is cancelled. When this field is filled in with a "Y" and I click the button to print what is on the screen, I just get a blank report. When I take the "Y" out of the field the report previews and prints what is on the screen. I am at a loss to figure out why this is happening. If anyone has any thoughts about this, please respond. Thanks

  2. #2
    5 Star Lounger
    Join Date
    Jan 2001
    Posts
    1,119
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Odd Report Behavior (2003)

    I figured it out. I looked at the query behind the report and the "cancelled" field had "Is Null" in the criteria field. I don't know why but I may have another problem because I took the Is Null out.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •