Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can I change the width of a field in an event?

Status
Not open for further replies.

Grandkathy

Technical User
Jan 13, 2005
32
0
0
US
I have a field that for some of the report will be the default width, but for one specific section of the report I need that field to be wider and the next field to be narrower.

Such as:
Me.RecommendYesNo.Left = 270
Me.RecommendYesNo.Width = 600
Me.RecommendedComment.Left = 2880
Me.RecommendedComment.Width = 9825

It keeps telling me:
Compile Error:
Method or data member not found

HELP please...
 
Yes, it can be done. Check out the name of your control. Is it the actual name of the control as seen in the property box? If you don't see the list of possible properties appear when you hit the "dot" then something isn't right - it doesn't know what control you are talking about.

Are you currently on the form the control is on when this form runs? It may be that you need to put Form_formName. instead of me.
 
oops - just realized you were referring to reports - I thought I was in the Forms forum! :) No, I don't believe you can alter the width of a control in reports. I could be wrong, so someone please correct me if I am, but to my knowledge, the width property of the control is not available in a report.
 
Thanks for you help. Yes you can change the size of the fields on a report, dependent on another field.

I thought I'd checked the actual name of the field, when in actuality, it was named "text15"....... Oops.

 
This little test works for me in a report:
Code:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
'Approx 567 twips/cm
If Len(Me.AText) > 5 Then
    Me.AText.Left = 200
    Me.AText.Width = 2500
Else
    Me.AText.Left = 2000
    Me.AText.Width = 250
End If
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top