Programatically change printer when a report opens.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • TAZdba
    New Member
    • Aug 2007
    • 5

    #1

    Programatically change printer when a report opens.

    Hi All,
    I have an Access97 frontend on a SQL Server 2005 back end database. Reading your forums, I discovered how to generate a dropdown list of available printers. I can also store the user's choice from the listbox in a front-end table. Now I need to know: Do you have any code that I can use to assign the printer to the report in the on_open event of the report? FYI, I'm trying to allow workstation users to define 2 default printers, 1 for sheet reports and another for labels. Any help would be much appreciated.
  • FishVal
    Recognized Expert Specialist
    • Jun 2007
    • 2656

    #2
    Originally posted by TAZdba
    Hi All,
    I have an Access97 frontend on a SQL Server 2005 back end database. Reading your forums, I discovered how to generate a dropdown list of available printers. I can also store the user's choice from the listbox in a front-end table. Now I need to know: Do you have any code that I can use to assign the printer to the report in the on_open event of the report? FYI, I'm trying to allow workstation users to define 2 default printers, 1 for sheet reports and another for labels. Any help would be much appreciated.
    Hi.

    See "ActivePrin ter property" topic in Access help.

    Comment

    • TAZdba
      New Member
      • Aug 2007
      • 5

      #3
      Originally posted by FishVal
      Hi.

      See "ActivePrin ter property" topic in Access help.
      I couldn't find any "ActivePrin ter" in Access97 help or in the VBA object browser. Where should I look next?

      Comment

      • TAZdba
        New Member
        • Aug 2007
        • 5

        #4
        I need to select a printer in a list box, and then print reports to that printer until the selection is changed. Any ideas? Please?

        Comment

        • FishVal
          Recognized Expert Specialist
          • Jun 2007
          • 2656

          #5
          Originally posted by TAZdba
          I need to select a printer in a list box, and then print reports to that printer until the selection is changed. Any ideas? Please?
          Sorry, I've never dealt with A97. I will ask the community to help you.

          Comment

          • puppydogbuddy
            Recognized Expert Top Contributor
            • May 2007
            • 1923

            #6
            Originally posted by FishVal
            Sorry, I've never dealt with A97. I will ask the community to help you.
            See this tip from www.aadconsulting.com

            Tip and Code Sample: Switching Printers from within your MS Access Application

            Fellow Access develepor, Mark Plumpton, of customdata.co.n z, has kindly provided sample code for easily switching printers on the fly while printing Access reports, with code as simple as this...

            SaveDefaultPrin ter
            DefaultPrinter = "HP Laserjet (A3)"
            DoCmd.OpenRepor t "rptTest", acViewNormal
            RestoreDefaultP rinter

            Download these demo Access97/2000 databases, which include a class module that performs the function of listing and switching default printers.

            The code is also an excellent example of how you can use classes in your MS Access applications.

            Comment

            • TAZdba
              New Member
              • Aug 2007
              • 5

              #7
              Originally posted by puppydogbuddy
              See this tip from www.aadconsulting.com

              Tip and Code Sample: Switching Printers from within your MS Access Application

              Fellow Access develepor, Mark Plumpton, of customdata.co.n z, has kindly provided sample code for easily switching printers on the fly while printing Access reports, with code as simple as this...

              SaveDefaultPrin ter
              DefaultPrinter = "HP Laserjet (A3)"
              DoCmd.OpenRepor t "rptTest", acViewNormal
              RestoreDefaultP rinter

              Download these demo Access97/2000 databases, which include a class module that performs the function of listing and switching default printers.

              The code is also an excellent example of how you can use classes in your MS Access applications.
              Hi and thanks PuppyDogBuddy,
              I haven't tried it yet, but this looks like exactly the kind of information that I was looking for. Thanks again.

              Comment

              Working...