Unbound Text Box showing Subform Data (1 Viewer)

stu_c

Registered User.
Local time
Today, 00:26
Joined
Sep 20, 2007
Messages
489
Hi all
I ham trying to have some headers with some relivant info across the top I have 3 forms
FrmFullDetails
SFRMStaffDetails
SFRMOfficeDetails

In the form header of Full Details I want a TextBox to show relevant information so when the user scrolls down the page this stays at the top of the page, the information I want to show is from the two Subforms named above but nothing works, the information is just for visual aid only and doesn't need to be editable, I have tried this code for each text box without any success what do I need to change?

I have put the below code in each of the control sources without any real success
Code:
=[SFRM_StaffDetails].[Form]![TXBStaffSurname]
=[SFRM_StaffDetails].[Form]![TXBStaffEmployeeID]
=[SFRM_OfficeDetails].[Form]![TXBOfficeID]

I have also tried an update code but the issue is the text wont change when going onto another record
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 07:26
Joined
May 7, 2009
Messages
19,231
add code to Each subform's (2 subform) Current Event that will Requery the 3 textboxes on the header:

private sub form_current
me.parent![textbox1_name].Requery
me.parent![textbox2_name].Requery
me.parent![textbox3_name].Requery
end sub

or

you just make the 3 textbox unbound (remove the =Expression) from each box.
and on the 2 subform's current event:

' 1st subform
private sub form_current
me.parent![textbox1_name]=me.TXBStaffSurname
me.parent![textbox2_name]=me.TXBStaffEmployeeID
end sub

'2nd subform
private sub form_current
me.parent![textbox3_name]=me.TXBOfficeID
end sub
 

stu_c

Registered User.
Local time
Today, 00:26
Joined
Sep 20, 2007
Messages
489
perfect thank you!
is this the same code if there is a subform within another subform, just trying to learn how it works for future?

add code to Each subform's (2 subform) Current Event that will Requery the 3 textboxes on the header:

private sub form_current
me.parent![textbox1_name].Requery
me.parent![textbox2_name].Requery
me.parent![textbox3_name].Requery
end sub

or

you just make the 3 textbox unbound (remove the =Expression) from each box.
and on the 2 subform's current event:

' 1st subform
private sub form_current
me.parent![textbox1_name]=me.TXBStaffSurname
me.parent![textbox2_name]=me.TXBStaffEmployeeID
end sub

'2nd subform
private sub form_current
me.parent![textbox3_name]=me.TXBOfficeID
end sub
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 07:26
Joined
May 7, 2009
Messages
19,231
how many subform deep, you also use Parent that much deep?!

if subform embedded on a subform (2 depth):

Me.Parent.Parent!txtboxName.Requery
 

stu_c

Registered User.
Local time
Today, 00:26
Joined
Sep 20, 2007
Messages
489
Thank you so much I will have a play and see what happens!, what is it going the other way from a subform back to a main form if parent is upwards

how many subform deep, you also use Parent that much deep?!

if subform embedded on a subform (2 depth):

Me.Parent.Parent!txtboxName.Requery
 

Users who are viewing this thread

Top Bottom