troubleshooting Question

textwidth method -- syntax question

Avatar of drozdzowski
drozdzowski asked on
25 Comments1 Solution782 ViewsLast Modified:

I want to autosize a textbox.  I put the following code in my reports detail "on format" event.  When I run the report, I get run-time error 438: object doesn't support this property or method

--------------------------start of code---------------------------
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Dim ctl As Control

For Each ctl In Me.Section(acDetail).Controls
    ' Get width of control to enable autosizing
    ctl.Width = Me.TextWidth(ctl)

Set ctl = Nothing
End Sub
--------------------------end of code------------------------------

What am I doing wrong?


Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 25 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 25 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros