Results 1 to 5 of 5
  1. #1
    2 Star Lounger
    Join Date
    Jan 2001
    Location
    Yreka, California, USA
    Posts
    192
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Report Fields Collapsing Row when No Value (2003)

    I hope I'm just not missing something here, but one of my users has asked me if on a form that includes an address block if there's a way to collapse the form or remove the Address2 field when there is no second line address. Does that make sense? Say she has Name, Address, Address2, City all on separate lines one right under the other. Only occasionally will she have a two line address and she'd like to close up that space or extra line. I've had my Access books out, but can't seem to see anything that would do that. Any ideas on whether it can be done or not?
    Thanks much, Judy Crawford

  2. #2
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: Report Fields Collapsing Row when No Value (20

    In general what you proposing is done in Reports rather than in Forms.

    The form is for viewing data on the screen, and entering/editing it. In this context you want to see the empty second address line.

    A report is for printing. Here you want it hidden.

    In the report set the CanShrink property of the second address line to yes, and also that of the section it is in.
    added later
    Even though your subject line talks about a Report, your actual post talks about a Form, so I have assumed you are actually talking about a Form.
    Regards
    John



  3. #3
    2 Star Lounger
    Join Date
    Jan 2001
    Location
    Yreka, California, USA
    Posts
    192
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Re: Report Fields Collapsing Row when No Value (20

    Thanks for catching me on the form/report issue. I know the difference and I really mean report, but typed form! Oh, well. We tried what you mentioned, but the problem ended up being a few fields on the report that were basically on the same line as the one we wanted to Shrink. So they'll have to live with it the way it is! If they delete the fields from the report that are on the right side of the report all works well. Thanks for you help on this one!
    Thanks much, Judy Crawford

  4. #4
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: Report Fields Collapsing Row when No Value (20

    If you can't get shrinking to work, you can do the work in the query instead.

    SELECT Trim([title] & " " & [firstname] & " " & [surname]) AS Line1, tblBuyers.Address1 AS Line2,
    IIf(Not ([address2] Is Null),[Address2],[town] & " " & [State] & " " & [Pcode]) AS line3,
    IIf([address2] Is Null," ",[Town] & " " & [State] & " " & [Pcode]) AS line4
    FROM tblBuyers;


    This query puts the name in line1, the first line of the address in line2.
    At line3 it makes a choice. If there is a second line in the address it uses it, otherwise it uses the town, state & postcode.
    At line 4 it also makes a choice, if it has already used town etc it leaves this line blank, otherwise town, state etc goes on this line.
    Regards
    John



  5. #5
    2 Star Lounger
    Join Date
    Jan 2001
    Location
    Yreka, California, USA
    Posts
    192
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Re: Report Fields Collapsing Row when No Value (20

    Thanks John, I'll show my user how to create this kind of query. Your effort is much appreciated.
    Thanks much, Judy Crawford

Posting Permissions

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