Set height for textbox in report with macros

K

krassi69

I have report with table and each cell is textbox with border solid. Each
textbox has "CanGrow" parameter set to "Yes". I would like all textboxes
horizontaly to have the same height. When "Name" textbox increase it's
height due to longer text, all other textboxes have to increase their height
too. I tried to do this with 2 ways but without success:
1. Macros
Action: SetValue
Item: [Reports]![TablePrice]![Number]![height]
Expression: [Reports]![TablePrice]![Name]![height]
2. Function
Detail - Format
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Reports!TablePrice!Number.Height = Reports!TablePrice!Name.Height
End Sub
I connected this macros and after that function to "onFormat" property of
"Detail" section of the report where is my table, but I receive errors.
Please help me !
 
M

Marshall Barton

krassi69 said:
I have report with table and each cell is textbox with border solid. Each
textbox has "CanGrow" parameter set to "Yes". I would like all textboxes
horizontaly to have the same height. When "Name" textbox increase it's
height due to longer text, all other textboxes have to increase their height
too. I tried to do this with 2 ways but without success:
1. Macros
Action: SetValue
Item: [Reports]![TablePrice]![Number]![height]
Expression: [Reports]![TablePrice]![Name]![height]
2. Function
Detail - Format
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Reports!TablePrice!Number.Height = Reports!TablePrice!Name.Height
End Sub
I connected this macros and after that function to "onFormat" property of
"Detail" section of the report where is my table, but I receive errors.


You're not going to be able to do what you want using the
text box borders.

What you'll have to do is use the detail's Print event to
draw the lines around the section using the report's Line
method. This can get tricky to figure out, so I suggest you
use the PrintLines code at www.lebans.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top