Results 1 to 2 of 2
  1. #1
    New Lounger
    Join Date
    May 2013
    Thanked 0 Times in 0 Posts

    Access 2010 Report Layout

    I have an Access 2010 database that is going to be used to generate a sales quote to send to potential customers. The current version generates a word document with the relevant bits of information going into a word table so that one set of information appears in column 1 and a 2nd set of information appears in column 2 so it looks professional and doesn't take up too much space on the page.

    In the next version I want the 'quote' to be an Access report so the layout is fixed. When users enter information of what the customer requires they pick from a variety of yes/no fields for the specification options and other optional extras that are available to the customer. I have set the 'can shrink' property of these fields on the report to Yes so that if the field has no data, the field doesn't appear on the report. However, if I position these fields side by side on the report, if one of the fields contains data the empty field is also 'displayed' although it is blank, leaving unnecessary white space.

    Is it possible to divide the detail section of the report into columns as you would in Word so that they behave differently from each other i.e so the fields without data 'shrink' but the field containing data is displayed.


  2. #2
    Join Date
    Feb 2011
    Thanked 6 Times in 6 Posts
    One way might be to position the data sequentially. For example, if you had say up to 21 data items to display, put 21 unbound text boxes in the report called txt01 to txt21, in say 3 columns, 7 rows

    Open a recordset with the 21 field values and then loop through the values with the following (air) code in the OnFormat event of the report

    intNextPosition = 1
    For n = 1 to 21
    if len(rst(n-1) & "")> 0 then
    me("txt" & format(intNextPosition ,"0#"))= rst(n-1)
    intNextPosition =intNextPosition +1
    next n

    I expect you'd also want to have labels describing the data being displayed. One way would be to store the label captions for the 21 fields in a string array and add
    me(lbl" & format(intNextPosition ,"0#")).caption= astrCaption(n)

    or if the field name were descriptive enough
    me(lbl" & format(intNextPosition ,"0#")).caption=rst(n-1).name

Posting Permissions

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