Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2003
    Location
    Knoxville, tn
    Posts
    2

    Talking Unanswered: Problem with print dialog box control. Please help!

    I am working on a project in access 2000 with VBA.

    Here is what happen.
    I created a custom button for user to print a form or report. I linked the button to following code to execute the print dialog box button.

    DoCmd.RunCommand acCmdPrint


    Is there any way that I can disable the "number of copies" control. So that, the user can only print one copy at a time.


    Please help!!
    Nick

  2. #2
    Join Date
    Oct 2003
    Location
    Canada
    Posts
    574
    In my program I would use an Active X common dialog control as below:

    If Me![Preview] = False Then 'This is from the OnClick event
    Call Fetch_Printer(numcopies, cancelbuttonpressed)
    If cancelbuttonpressed Then GoTo Abort_Interim_Case
    End If



    Public Sub Fetch_Printer(numcopies, cancelbuttonpressed)
    DoCmd.Hourglass False
    cancelbuttonpressed = False
    CommonDialog.Copies = 1
    CommonDialog.CancelError = True
    On Error GoTo CancelButton
    CommonDialog.flags = &H100000 Or &H8& Or &H4&
    CommonDialog.ShowPrinter
    numcopies = CommonDialog.Copies
    Exit Sub
    CancelButton:
    cancelbuttonpressed = True
    Exit Sub
    End Sub

  3. #3
    Join Date
    Oct 2003
    Location
    Knoxville, tn
    Posts
    2

    Talking

    Thanks alot!!!!

    Work very well....

Posting Permissions

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