Results 1 to 7 of 7
  1. #1
    Join Date
    Sep 2004
    Location
    Raleigh, NC
    Posts
    146

    Unanswered: Output to multiple networked printers

    I have a database that records advertising information for a small publication. The database is accessed by (3) departments: sales, accounting, and production. Currently, information for all of those departments is printed on 1 common report. I would like the ability to separate the information into 3 individuals reports and output those forms to 3 individual networked printers. When the operator presses a command button to save the info, I want corresponding reports to output on a printer in the sales department, accounting department, and production department. I'm stumped on this one, anyone have any ideas?

  2. #2
    Join Date
    Apr 2004
    Location
    outside the rim
    Posts
    1,011
    Working directly with printers has never been a strong point in Access when trying to build applications.

    The most straight forward way is to open each report in design view and set the printer setup to "Specific Printer" and select the desired printer. Have 3 separate reports and use the DoCmd.OpenReport with the acNormal flag for each report in code behind the button. This generally works, depending on how the network and the printers are setup.

    There are more complicated ways of accomplishing printer control. For a complicated set of controls that allow you full control over the printer functions, try this.

    Good luck ... although providing a common control interface for applications to print was one of Bill Gate's original intentions with creating Windows, printer control still leaves a lot to be desired on the developer's side.
    have fun!

    Todd S.
    click to email


    Independent Development Consultant
    Biz db & reports - SQL, Access, Crystal, Seradex and more
    Small, custom, unique programs - Office, VBA, .NET


    _________________________________________________
    Favorite message from Windows:
    There was an error displaying the previous error message

    Sadly, there was no error number to look up ...

  3. #3
    Join Date
    Apr 2004
    Location
    outside the rim
    Posts
    1,011
    The "ch10.mdb" file referenced in the article is available here

  4. #4
    Join Date
    Sep 2004
    Location
    Raleigh, NC
    Posts
    146
    I figured I'd have to create individual reports and then tie each one to a specific printer. The question now is, can I tie all three reports to 1 specific command button so that when clicked, the button invokes the printing of all 3 reports?

  5. #5
    Join Date
    Apr 2004
    Location
    outside the rim
    Posts
    1,011
    Yep.

    Ae you familiar with adding code in the modules behind the forms? You mentioned a "Save" button. If your save button goes to a macro, convert the macro to code and then add the following lines to your code:
    Code:
    Dim strSQL As String
    strSQL = "[MyField] = '" Me.MyField & "'" ' The Where Clause
    DoCmd.OpenReport "ReportName_1", acViewNormal, , strSQL
    DoCmd.OpenReport "ReportName_2", acViewNormal, , strSQL
    DoCmd.OpenReport "ReportName_3", acViewNormal, , strSQL
    The strSQL is only needed if you are applying a filter to the report. If you are not, drop the strSQL and the last two commas.

    The acViewNormal flag will print the report - the "Normal" state for a report is to be printed.

    Have fun!
    have fun!

    Todd S.
    click to email


    Independent Development Consultant
    Biz db & reports - SQL, Access, Crystal, Seradex and more
    Small, custom, unique programs - Office, VBA, .NET


    _________________________________________________
    Favorite message from Windows:
    There was an error displaying the previous error message

    Sadly, there was no error number to look up ...

  6. #6
    Join Date
    Sep 2004
    Location
    Raleigh, NC
    Posts
    146
    Ok, everything worked great with the code, but all 3 of the reports printed from one printer. (Which is set as default on my system) I opened each form individually and changed the "Selected Printer", but when I print the reports, everything reverts back to the defaulted printer. Any ideas?

  7. #7
    Join Date
    Apr 2004
    Location
    outside the rim
    Posts
    1,011
    What version of Access are you using?

    In 97 and 2K, open the report in design view and open the Page Setup.
    Click the Page tab and on the bottom should be the option: Default Printer or Use Specific Printer.

    Select Use Specific Printer and then press the printer button to select the printer you want.

    For this to work, the desired printer must be setup with the same name on your machine and every machine who is going to run it.

    If somebody opens the report and does not have the printer, it will kick the report back to default - so this is not a very reliable way to do it (you'll be babysitting it).

    I imagine the setup is the same in 2003 - I'll know for myself soon.

    Good luck.
    Last edited by tcace; 10-18-04 at 18:35.

Posting Permissions

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