Results 1 to 6 of 6
  1. #1
    Star Lounger
    Join Date
    Apr 2001
    Location
    Melbourne, Australia
    Posts
    53
    Thanks
    2
    Thanked 1 Time in 1 Post

    Changing Printer in an MDE (Access97)

    The invaluable reference by Litwin, Getz et al has a chapter on code for changing printers or printer properties when printing reports, and the relevant Microsoft Knowledgebase article gives this as a reference also.

    However, the technique depends on opening the report in design mode, and hence is not available when the database is compiled into an MDE file.

    Is there a code-driven technique for allowing a user to select one from the list of available printers, please?

    Thanks.
    Geoff G

  2. #2
    5 Star Lounger
    Join Date
    Aug 2001
    Location
    Surrey, United Kingdom
    Posts
    1,001
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Changing Printer in an MDE (Access97)

    Is this what you are looking for? it is by Getz and automatically finds all printers on a PC.

    Steve
    Attached Files Attached Files
    Cheers

    Steve

    Asking the questions everbody wants the answers too but feels too stupid to ask themselves :-)

  3. #3
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Cornwall, England
    Posts
    393
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Changing Printer in an MDE (Access97)

    the way that i would use would be to insert a MicrosoftCommonDialog Control on the form and then code an onclick event for a button to be
    Sub cmdPrinter_Click
    ctlPrinters.showPrinter
    End Sub

    where you have renamed the common control to ctlPrinters and the command button is renamed to cmdPrinters

    When the button is clicked, this will open the dialog that is familiar to most users and gives you plenty of scope for print / printer administration from the PC.

    HTH

  4. #4
    Star Lounger
    Join Date
    Apr 2001
    Location
    Melbourne, Australia
    Posts
    53
    Thanks
    2
    Thanked 1 Time in 1 Post

    Re: Changing Printer in an MDE (Access97)

    Thanks for the suggestions. I'm sorry I did not make myself clear - the point of my enquiry was that I want to avoid asking the user anything.

    Steve suggested a utility set from Ken Getz to allow me to find all printers. Thanks Steve. That was the one I referred to in my original post. Getz gives a way to use this to change printers, but it only works if you have the ability to open the relevant report in design mode - which is not the case in an MDE file.

    fatherjack suggested a way I can invoke the standard print control form, but my need is to be able to change printers using code (ie, not involving the user).

    Any other sugggestions would be helpful.
    Thanks.

    Geoff G

  5. #5
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Changing Printer in an MDE (Access97)

    If there are multiple printers, you *can't* avoid asking the user anything. You have to allow them to tell you which printer they want to use because you have no way of knowing if one of them is clear across the building.
    Charlotte

  6. #6
    Star Lounger
    Join Date
    Apr 2001
    Location
    Melbourne, Australia
    Posts
    53
    Thanks
    2
    Thanked 1 Time in 1 Post

    Re: Changing Printer in an MDE (Access97)

    Thanks Charlotte. In fact, I do have a way, as I control the end-user environment. Let me paint a scenario. I do know which is, for example, the colour printer, which the A3, etc. I need to be able to reconfigure the network, change names, etc of printers (not frequently, but it happens). I store the relevant information in the (shared) back-end database, so that this information is available to the end-user application. My users do not know or need to know this information in this environment. I want to be able to pick up the data and, in code, select printers. There are other reasons, too, but I hope this gives you the picture.
    Geoff G

Posting Permissions

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