• hiding a control (A2K SR1)

    Author
    Topic
    #357470

    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?

    Viewing 0 reply threads
    Author
    Replies
    • #531118

      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.

      • #531167

        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?

        • #531173

          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 RptSmp00.exe from Microsoft which contains a report showing lines drawn from code on a report. That might help you.

          • #531183

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

    Viewing 0 reply threads
    Reply To: hiding a control (A2K SR1)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: