Results 1 to 9 of 9
  1. #1
    Join Date
    Jun 2005
    Posts
    43

    Unanswered: report: "Can Grow" property

    greetings, all:

    i have a question in Access 2000 / Reports...

    i have a text box that is bound to a field in a query whose Can Grow property is set to yes. now, to the left of this text box are three additional text boxes whose Can Grow property is set to no. i've set all of the borders of these four fields to show some solid line, so that it looks like a table (4 columns by however many entires for that particular record).

    if the text box w/Can Grow = yes grows to multiple lines, i'd like the the other three text boxes to grow, so that it still looks like one row. as it stands now, when the "comment" box grows to multiple lines, the others stay the same. so, it's kinda like, in excel, bordering 3 cells from left to right with the 4th cell 3 cells down. just looks funny. (hope this makes sense.)

    is this something that can be done?

    i was thinking something in vba, but i'm pretty new to that, so i'm unsure.

    any thoughts?
    Mos

  2. #2
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    I imagine something like
    Code:
    Me.OneOfThose3Textboxes.Height = Me.TheExpandingTextBox.Height
    Could do what you want.
    George
    Home | Blog

  3. #3
    Join Date
    Jun 2005
    Posts
    43
    thank you for the direction!

    cheers.
    Mos

  4. #4
    Join Date
    Jun 2005
    Posts
    43
    hmm, that didn't work, and when i click . height isn't an option that is available. properties is, but then i'm not sure what to do after that.

    i do appreciate your attention, though...
    Mos

  5. #5
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    Just an idea...
    I'm thinking you might be able to pad the other fields with a string of space characters to make the length of the strings match (you would do this in expressions for the query of the report.) With the length of each of the fields the same, you might be able to accomplish the same height (but note that the width of the different text boxes on the report could be a factor also in setting the height.)

    So you might have an expression in the query like Exp: =[FieldY] & string(len([FieldX])-len([FieldY])," ") or you may need to have multiple expressions where one expression is the ExpLenX: len([FieldX]) and another is the ExpLenY: len([FieldY]) and another expression which is =iif([ExpLenX]>[ExpLenY], [FieldY] & string([ExpLenX]-[ExpLenY]," "),[FieldY] & string([ExpLenY]-[ExpLenX]," ")). If the width of the text boxes are different on the report, you may need to experiment with the equation to determine the correct number of spaces to pad into the field (which could be tricky). I'm also guessing that padding the field with spaces will work but you may need to pad it with a different character to account for any 'trimming' of the field if the space character doesn't work (perhaps there is another character which works like the space character but doesn't display anything and doesn't trim the field.) You may be able to incorporate the above equations in the OnFormat event of the report.

    I didn't really test this out and it may not be the exact solution you need but in concept it sounds like it could work. But again, there may be an easier solution.
    Last edited by pkstormy; 09-27-07 at 14:46.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  6. #6
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    you may have to accept you cannot get the dinky formatting you want

    alternatively you could tinker around with vertical line lengths in the reports details on format event.
    I'd rather be riding on the Tiger 800 or the Norton

  7. #7
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    I agree with healdem, the idea I provided probably won't work as capitol letters have a slightly different width verses small letters and it would probably be difficult finding the correct length.

    Just as a note, I was able to set the height of the text box on the report in the onFormat event with me.MyField.Height = 1000 or me.MyField.Height = me.MyField2.Height even though the Height doesn't appear in the wizard when typing the command but I couldn't get it to change the height from record to record.
    Last edited by pkstormy; 09-27-07 at 14:54.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  8. #8
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    Ah...There is a tricky way to do what you want....(which is fairly easy to implement.)

    Have another text box which has the same Control Source as the field you want to match the height of (ie. comments field). Since you're mostly concerned with the border of this box, you can set the color of the text font color of this text box to white (or whatever the background color of the report is.) Then overlay the field you want to display on top of this text box (setting the border of this text box to transparent). It'll do what you want to do (providing the comments field is always going to be the longest field. If you have Comments which is longer than SomeFieldA for 1 record and the next record SomeFieldA is longer than Comments, it may give you problems.)
    Last edited by pkstormy; 09-27-07 at 15:32.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  9. #9
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    You could solve the delima of SomeFieldA being longer than the Comments field in the solution above by setting an expression in your query for the report which is the longest field (ie. ExpLongField: iif(len([Comments]>len([SomeFieldA],[Comments],[SomeFieldA]). (you can add in SomeFieldB also in this expression - you want to find the longest field for the expression ExpLongField in the query.) Then using the solution above, have 2 (or more) fields on your report with the Control Source = ExpLongField, setting the font color of these fields to white. This gets you the border. Then overlay your other fields onto each of the ExpLongField.
    Last edited by pkstormy; 09-27-07 at 15:34.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

Posting Permissions

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