Wups, the pictures didnt upload last time.
Wups, the pictures didnt upload last time.
So I went a back alley way to solve this problem, if anyone thinks this is a good way or a bad way please let me know why so I can learn from it. Thanks
Code:Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer) ShowPage sSizeChange ("txtLocationTest") End SubCode:Sub sSizeChange(sz As String) Dim testlen As Long If IsNull(Me.Controls(sz)) = False Then testlen = Me.TextWidth(Me.Controls(sz)) Me.Controls(sz).Width = testlen End If End Sub
For some reason the .TextWidth control gets less accurate when it is small and large so I had to make some minor adjustments.
Code:Sub sSizeChange(sz As String) Dim testlen As Long If IsNull(Me.Controls(sz)) = False Then testlen = Me.TextWidth(Me.Controls(sz)) If testlen > 900 Then Me.Controls(sz).Width = testlen - (testlen * 0.1) ElseIf testlen < 600 Then Me.Controls(sz).Width = testlen + (testlen * 0.1) Else Me.Controls(sz).Width = testlen End If End If End Sub
Wow, I had to call up microsoft and the access tech guy didnt even know how to use this property. Turns out the .textwidth uses the reports fontsize and fontname which is defaulted to Calibri size 8. These 2 properties can not be changed except with VBA. I believe I have everything working now but maybe this post will help someone else in the future.