Referring To Controls On A Subform

LarryB

Registered User.
Local time
Today, 21:00
Joined
Jun 19, 2012
Messages
66
Apologies for the repost - My previous thread was bombed and I was directed to this location by a mod

http://access.mvps.org/access/forms/frm0031.htm

After reviewing the above thread I have got this far with referring to the subform. But I am getting a property let and get failure message. Reluctently I have to repost, sorry lads but I would like some more help with this.

I am trying to set the control tip text for each text box on a subform to it's value.

This code is located in the Main Form On Current event

Dim ctrl As Control
For Each ctrl In Me![SubFormWires].Form
If ctrl.ControlType = acTextBox Then
Me![SubFormWires].Form.Controls(ctrl.Name)![ControlTipText] = Nz(Me![SubFormWires].Form.Controls(ctrl.Name)![Value], "")
End If
Next ctrl


Basically I have lot of locked fields on the subform and sometimes it's text can overrun it's allocated space. The use of the control tip text will reveal it's full data once the mouse is hovered over it.

I have similar code in place on the main for which works fine.

Any further help will be much appreciated

LarryB
 
Have you tried

Forms!formname!subformname.Form.controlname
 
Thank You

New code

Dim ctrl as control

For Each ctrl In Forms!frmlfund!SubFormWires.Form
If ctrl.ControlType = acTextBox Then
Forms!frmlfund!SubFormWires.Form.Controls(ctrl.Name).ControlTipText = Nz(Forms!frmlfund!SubFormWires.Form.Controls(ctrl.Name).Value, "")
End If
Next ctrl

frmlfund being my main form
subformwires being my sub
open brackets taken off my field property

Cheers

LarryB
 

Users who are viewing this thread

Back
Top Bottom