Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2002
    Location
    Arkansas
    Posts
    13

    Unanswered: code in open event on a report not firing

    The following code appears in the open event of a report:

    DoCmd.OpenForm "frmDateRange", acNormal, , , , acDialog

    This problem is this code fires in preview mode but not print mode.

    Any ideas?

    Thx

    Tag

  2. #2
    Join Date
    Feb 2002
    Posts
    403
    The on open event only fires on opening the report. The format property is the property you want if you want the form to open on print.

  3. #3
    Join Date
    Aug 2002
    Location
    Arkansas
    Posts
    13
    Originally posted by dynamictiger
    The on open event only fires on opening the report. The format property is the property you want if you want the form to open on print.
    Thanks for your reply.

    I want the form to open before printing. It contains the date range and other info needed to run the report. The open events fires if the report is previewed or printed but the code to open the form does not appear to run if you choice to print instead of preview the same report.

    With this code the form opens:
    stDocName = "RICRHR"
    DoCmd.OpenReport stDocName, acPreview


    With this code the form does not open.
    stDocName = "RICRHR"
    DoCmd.OpenReport stDocName, acNormal


    This is the open event code from the report:
    Private Sub Report_Open(Cancel As Integer)

    DoCmd.OpenForm "frmDateRange", acNormal, , , , acDialog
    fncBegdate
    fncEnddate


    If gBegDate = "" Then
    Cancel = True
    End If


    End Sub




    Thx

    Tag

Posting Permissions

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