Results 1 to 2 of 2
  1. #1
    ccordner is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Nov 2011
    Posts
    65

    Setting Report Height In Code

    Hi



    I have a report (actually used as a subreport, but created as a report in its own right) which lists a set of categories and the percentage of each. These are sorted from largest to smallest. I want it to appear in columns, but if I set it as "across then down", it looks a bit silly.

    I read in a different forum of using code similar to this:

    Code:
     
    Private Sub ReportHeader_Format(Cancel As Integer, FormatCount As Integer)
    rptRDWTypesYearToDate.Height = 20 / 2 * 0.25 * 1440
    End Sub
    Which works out the height of the report (2 is the number of columns, 20 is the number of items in total, .25 is the height (in inches) of each row and 1440 is something called twips, per inch.

    But it says "Object required". Am I using the wrong code, or in the wrong place? Ultimately I want to replace 20 with Dcount [JustificationCategory] but I thought I'd get it working with a number first.

    Also

    I have this subreport, positioned in the header. How do I make the labels below it move up and down and the height of the header increase, depending on the size of the subreport?

    Chris

  2. #2
    Rod is offline Expert
    Windows 7 32bit Access 2007
    Join Date
    Jun 2011
    Location
    Metro Manila, Philippines
    Posts
    679
    You will probably find that rptRDWTypesYearToDate is nothing. Debug and check this.

    Check the properties of the sub report control. I can't remember offhand but there's something like can shrink/can grow.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 4
    Last Post: 09-15-2012, 07:31 PM
  2. Replies: 10
    Last Post: 01-04-2012, 01:43 PM
  3. Setting up a mail merge or report letter
    By AndrewsPanda in forum Access
    Replies: 8
    Last Post: 09-29-2011, 05:59 PM
  4. Setting Printer when Printing Report
    By russ0670 in forum Reports
    Replies: 3
    Last Post: 05-12-2010, 09:45 AM
  5. Setting a field in order for Report
    By cotri in forum Reports
    Replies: 2
    Last Post: 01-28-2010, 02:44 PM

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