Results 1 to 6 of 6
  1. #1
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Printing From Dialog Form Problem? (a2k (9.0.6926) SP-3 Jet 4.0 SP-8)

    I have a form that I open in Dialog Mode

    On this form I print a one page receipt to the printer

    This works OK

    If I print a second receipt it prints in to Preview Mode and I can

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Printing From Dialog Form Problem? (a2k (9.0.6926) SP-3 Jet 4.0 SP-8)

    Do you use code to print? If so, what is the code?

  3. #3
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Printing From Dialog Form Problem? (a2k (9.0.6926) SP-3 Jet 4.0 SP-8)

    <pre>If strPrintIDorFiltered = "I" Then ' print from ID
    If Me.Dirty Then
    DoCmd.RunCommand acCmdSaveRecord
    End If
    strFilter = "[lngDLicenseID]=" & Me!lngDLicenseID
    If mstrCallingFormName = "frm_POS_Detail" _
    And gloGetValue("OpenedFormAsDialog") = "Yes" Then
    DoCmd.OpenReport strDocName, , acViewNormal, strFilter
    gloSetValue "OpenedFormAsDialog", "No"
    Else
    DoCmd.OpenReport strDocName, acPreview, , strFilter
    End If
    End If
    </pre>



    <pre>Private Sub Form_Open(Cancel As Integer)
    If Not IsNull(Me.OpenArgs) Then
    mstrCallingFormName = Me.OpenArgs
    End If
    End Sub
    </pre>


  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Printing From Dialog Form Problem? (a2k (9.0.6926) SP-3 Jet 4.0 SP-8)

    The first time you call the code, presumably OpenedFormAsDialog is "Yes", so the report is sent directly to the printer (acViewNormal means print), and OpenedFormAsDialog is set to "No". Next time, since OpenedFormAsDialog is "No", the report is opened in preview mode (acPreview - why don't you use acViewPreview for consistency? - means preview). So the code seems to be doing exactly what you tell it to do.

  5. #5
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Printing From Dialog Form Problem? (a2k (9.0.6926) SP-3 Jet 4.0 SP-8)

    Thanks for pointing out the obvious

    I moved gloSetValue "OpenedFormAsDialog", "No" to another location to solve my immediate problem

    <why don't you use acViewPreview for consistency?>

    When I print from a Form opened in Dialog mode, you can

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Printing From Dialog Form Problem? (a2k (9.0.6926) SP-3 Jet 4.0 SP-8)

    My question was facetious, you used acViewNormal for printing, its counterpart for viewing is acViewPreview. The constants acNormal and acPreview are remnants from an older version of Access, still available for compatibility. I commented on the mixed use acViewNormal vs acPreview. <img src=/S/grin.gif border=0 alt=grin width=15 height=15>

    If you open a report in preview mode from a dialog form, it will be displayed behind the dialog form. I don't think you can change that in Access 2000.

Posting Permissions

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