Results 1 to 5 of 5
  1. #1
    Star Lounger
    Join Date
    Jan 2001
    Location
    Kansas, USA
    Posts
    73
    Thanks
    0
    Thanked 0 Times in 0 Posts

    hiding a control (A2K SR1)

    I have a report with fields like QuanO, QuanD, SKU, Desc, Price. In the detail section the SKU field is directly under the Desc field so that it always displays the item number under the description. However, if we type comments on the order, the item number becomes REM and the description then is the typed-in comment. The following is the data source for the SKU field: "=IIf([sku]="REM"," ",[SKU])" That blanks out the REM from showing, but it leaves a blank line where the SKU control is. What I would like to do is to shrink the detail section to 1 line when the SKU=REM. Can I do that through code, or is there a better way? Any ideas?

  2. #2
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: hiding a control (A2K SR1)

    The simplest way to deal with it, assuming that nothing else is on the same line with the SKU field, is to set the SKU field to something approximating a zero height. Then set the CanGrow property of both the control and the section to True. Move the other controls up close beneath the SKU control. Then change your formula to "=IIf([sku]="REM",Null,[SKU])".

    The result will be that the row will appear when you have an SKU and disappear when you don't. The SKU field will expand to display data and will push the rows below it down but will not do so when the value is null.
    Charlotte

  3. #3
    Star Lounger
    Join Date
    Jan 2001
    Location
    Kansas, USA
    Posts
    73
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: hiding a control (A2K SR1)

    Charlotte--thanks, that works, but I have vertical lines in that detail section to create columns. I made the vertical lines the same height as the detail section, but when it grows, the lines don't so they become dashed lines. Can I make a function to set the line height? iif([sku]="REM",null,funSetLine) Or is there a better way?

  4. #4
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: hiding a control (A2K SR1)

    I did warn you about other controls on the same line being pushed down, didn't I? Do your line lengths depend on section height or did you just size them in at a fixed height for each row? You can download a sample reports database <A target="_blank" HREF=http://support.microsoft.com/support/kb/articles/Q231/8/51.ASP>RptSmp00.exe</A> from Microsoft which contains a report showing lines drawn from code on a report. That might help you.
    Charlotte

  5. #5
    Star Lounger
    Join Date
    Jan 2001
    Location
    Kansas, USA
    Posts
    73
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: hiding a control (A2K SR1)

    Thanks again Charlotte. I got it to work by using code from the sample database.

Posting Permissions

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