Carlit007
New Member
- Joined
- Sep 5, 2018
- Messages
- 47
- Office Version
- 2019
- 2016
- 2013
- Platform
- Windows
- MacOS
Hi I Have a Access report that is used to populate a form that has 16 rows of data each roughly line is .32 in height
the report is based on a query of serial numbers and grouped by equipment type
If the query returns enough serial number to fill out 2 lines of data there are no issues with the formatting & space
however if there's enough serials to go over 2 lines of data then everything is thrown out of sync
note: I have the grouping & bound textbox set to can grow
however when anything goes past 2 rows of data per item then the formatting gets all out of order
when the query moves to the next equipment category
is there a way with vba to set a condition that if more than 2 lines of data to reset the size to stay within the .32 margin
I came across the following just not sure how to implement on my report
for reference this is what the report look like currently
the report is based on a query of serial numbers and grouped by equipment type
If the query returns enough serial number to fill out 2 lines of data there are no issues with the formatting & space
however if there's enough serials to go over 2 lines of data then everything is thrown out of sync
note: I have the grouping & bound textbox set to can grow
however when anything goes past 2 rows of data per item then the formatting gets all out of order
when the query moves to the next equipment category
is there a way with vba to set a condition that if more than 2 lines of data to reset the size to stay within the .32 margin
I came across the following just not sure how to implement on my report
VBA Code:
Private Sub Ctl2062equiparea_Paint()
Dim dblTextBoxHeight As Long
Dim intTextBoxHeightMultiplier As Long
dblTextBoxHeight = Me.SerialNumberctrl.Height
intTextBoxHeightMultiplier = 1
'loop control starts
'code here
'intTextBoxHeightMultiplier = intTextBoxHeightMultiplier + 1
'loop control ends
'Me.SerialNumberctrl.Height = dblTextBoxHeight * intTextBoxHeightMultiplier
'Me.SerialNumberctrl.Height = 0.32
End Sub
for reference this is what the report look like currently