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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Refer to a field on a Subform -sorry!

Status
Not open for further replies.

brendoaccess

Technical User
Mar 28, 2006
27
GB
I have a form frmPerson, with FirstName and Surname fields, with tabs. On a tab called Home Details I have a sub form, "frmHomeDetails" with fields Address1, Address2, etc.

I have an on click bit of code to send field contents to book marks in Word - which works, until it comes to referencing the fields on the subform.

This works:

.Selection.Goto What:=wdGoToBookmark, Name:="Surname"
If Not IsNull(Me.Surname) Then
.Selection.TypeText CStr(Me.Surname)
End If

This doesn't:

.Selection.Goto What:=wdGoToBookmark, Name:="Address1"
If Not IsNull(Me!frmHomeDetails.Form!Address1) Then
.Selection.TypeText CStr(Me!frmHomeDetails.Form!Address1)
End If


I have looked at and tried all the combinations on there with Me. Me! in all the combinations possible.

All help greatly appreciated.
 
How are ya brendoaccess . . .

Have a look here: How to refer to a control on a subform or subreport in Access

Calvin.gif
See Ya! . . . . . .

Be sure to see thread181-473997
 
Thanks for replying, The AceMan1 - carried on looking on the net last night and found this post;


which indicated a corrupt subform.

Everything now sorted after replacing subform and compact/repair. (fingers crossed).

Thanks again - always good to know you're still there.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top