Unbound Text Box showing Subform Data

stu_c

Registered User.
Local time
Today, 04:21
Joined
Sep 20, 2007
Messages
494
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
 
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
 
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
 
how many subform deep, you also use Parent that much deep?!

if subform embedded on a subform (2 depth):

Me.Parent.Parent!txtboxName.Requery
 
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

Back
Top Bottom