Page 2 of 2 FirstFirst 12
Results 16 to 18 of 18
  1. #16
    twgonder is offline Expert
    Windows 10 Access 2016
    Join Date
    Jun 2022
    Location
    Colombia
    Posts
    658

    The db that created the org report

    This is one I hacked together to test self-joins, creating one table to hold a variety of user defined fields with just one table, and changing the color of reports for the application module (i.e. Hr = Human Resources). We have tbl_Hr_Dept for departments in an organization. A department is a place where people can do some work.



    By using self joins and a sort field, one can create an organizational report from the board on down to every department.
    The tbl_Au_AppGrp allows for the client to define their own structures on top of my standard application. They are called groups and are hierarchical.

    I cleaned up some sorting and grouping from the prior sample report in post #13

    To see the "org report" run rpt_Hr_GrpDeptLu5.
    Attached Files Attached Files
    Last edited by twgonder; 07-18-2022 at 10:51 AM.

  2. #17
    twgonder is offline Expert
    Windows 10 Access 2016
    Join Date
    Jun 2022
    Location
    Colombia
    Posts
    658

    Now, how about that print command button?

    I FIGURED OUT HOW TO DO IT, SO I WANT TO DELETE THIS POST, BUT I CAN'T SEE HOW TO DO THAT.

    On the report in the above post (#16) I have the rpt_Hr_GrpDeptLu5.
    I've put a print command button there.
    At the moment, it changes the colors to black and white, and then I want to get it to print (preview).
    All the code that does this, I would like to place in module
    mod_Au_Report, so that the Private Sub cmdPrint_Click() calls the subroutine for the heavy lifting.
    This way I don't have to repeat all the detail code in each class object for different reports.
    You can see the idea of this in the Private Sub Report_Load() code, which calls the module mod_Au_Report for changing colors.

    I've hunted around and all the people that show how to print from a report hard code the report name in the class object.
    This seems bad seeing that the report can be renamed, and doesn't reuse common code in a module.
    And, they haven't explained well how they do the print.
    I would like to open in print preview after changing the colors, and close the report when done starting the print.

    Got an idea how to accomplish this?

  3. #18
    twgonder is offline Expert
    Windows 10 Access 2016
    Join Date
    Jun 2022
    Location
    Colombia
    Posts
    658

    Now a print error

    Quote Originally Posted by twgonder View Post
    I FIGURED OUT HOW TO DO IT, SO I WANT TO DELETE THIS POST, BUT I CAN'T SEE HOW TO DO THAT.
    Not so fast.
    I updated the db in post #16 to include the code I've done for the command Print.
    If I try the setup button I get an error, but I'm not sure what it means or how to avoid it.
    Click image for larger version. 

Name:	CmdPrint1.jpg 
Views:	11 
Size:	109.4 KB 
ID:	48341

    Finally, I would like to call the print preview, if possible and close the report.

    >>>

    I did try changing the line to this: DoCmd.RunCommand acCmdPrintPreview
    but it hangs and doesn't change the color of the report to the black&white colors.

    Just to mention, here in Colombia we use Oficio paper instead of legal for large sizes. It's 8.5 x 13". I'm designing the larger reports for that size paper.
    Last edited by twgonder; 07-18-2022 at 11:07 AM. Reason: More info

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 3
    Last Post: 01-26-2022, 05:59 PM
  2. check, create and link a table in BE?
    By Frits1969 in forum Access
    Replies: 1
    Last Post: 04-21-2016, 02:34 AM
  3. Replies: 1
    Last Post: 03-05-2013, 02:17 PM
  4. Replies: 4
    Last Post: 01-05-2013, 02:43 AM
  5. Create link table to .dbf that contains memo feald
    By vskarica in forum Import/Export Data
    Replies: 3
    Last Post: 10-06-2010, 12:08 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums