Results 1 to 7 of 7
  1. #1
    Join Date
    Jun 2009
    Posts
    89

    Unanswered: Reapply text box CanGrow property in report??

    HI. I've got a report where I am assigning values to text boxes on the Report_Open event.

    THe issue I'm having is that the text box size is determined before the Open event, and so CanGrow and CanShirnk are aplied before the text has any text in it.

    I can't apply values to the textbox if it is bound either as it gives an error.

    Is there a way to "redraw" the report with the current data?

  2. #2
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    Where on the report do these textboxes reside, i.e header, detail or footer section. It doesn't really make sense that the height is set before it's populated with data,
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  3. #3
    Join Date
    Jun 2009
    Posts
    89
    Most of the text boxes are in teh report header, and there is also one in the foooter of one of my groupings.

    All of them have the same problem.

    I set their data in the Report_Open event, is there an event before this that I can access in VB?

  4. #4
    Join Date
    Jun 2009
    Posts
    89
    Anyone have any idea?

    another solution would be to have all the textboxes bound, but once they're bound I get an error when I try change their value with vba that they cannot be updated.

  5. #5
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    I don't think having them bound will either. My guess would be that the location is the problem. When you set CanGrow for a textbox on the Detail Section to Yes, Access automatically sets CanGrow for the Detail Section to Yes. The problem you're having, I suspect, is that it doesn't do this for the Header or Footer sections, because this property doesn't apply to them, and hence the textboxes themselves have no room to grow into.

    The only workaround I can see is that you'll have to programatically change the section height, based on the data you're assigning. before actually assigning the value:

    Me.FormHeader.Height = 1440
    Me.FormFooter.Height = 2880

    where the numeric value is given in twips. 1440 twips = 1 inch.
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  6. #6
    Join Date
    Jun 2009
    Posts
    89
    It's not the sections that aren't growin. i've tried setting the sections really big but the textbox still doesn't grow.

    I forgot to mention that when the textboxes are bound, they grow perfectly. It's only when I set their values on the reports onopen event that they stay the size they are in design view.

  7. #7
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    Quote Originally Posted by rudeboymcc
    I forgot to mention that when the textboxes are bound, they grow perfectly. It's only when I set their values on the reports onopen event that they stay the size they are in design view.
    I don't think CanGrow will work with unbound controls; how would Access know how big to make them?
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

Posting Permissions

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