2 Forms 1 subform "After Update" event (1 Viewer)

Joe8915

Registered User.
Local time
Today, 00:21
Joined
Sep 9, 2002
Messages
820
Good morning all, this is what I have:

Main Frm
Sub form
Form= FrmEmployee Hire
1 Text key called Text1

Need to update the Sub form from FrmEmployee Hire
I used the “After update” Event in the main Frm and it work great.
What Event would I use from the FrmEmployee Hire to update the sub form?

Structure:
1st FormMain Form
Sub form
Text1
2nd Form= FrmEmployee Hire ………. (Update from here to the Sub form)
Text1


Thanks and have great Turkey Day
 

boblarson

Smeghead
Local time
Yesterday, 23:21
Joined
Jan 12, 2001
Messages
32,059
Quick question, why are you updating the subform from the main form? What exactly are you attempting? Hopefully you aren't storing the same data multiple times.

That being said, remember you have to refer to the subform using the syntax:

Me.SubformControlNameHere.Form.Control

You need to refer to the subform control (control on the main form which houses/stores the subform) and not the name of the subform itself unless they are exactly the same. And the .Form. part stays exactly as shown.
 

Joe8915

Registered User.
Local time
Today, 00:21
Joined
Sep 9, 2002
Messages
820
Bob, I am sure that not storing it twice. On the Main form where sits the subform. I have a text field called ED Rate. In the following I have this as event procedure:
Private Sub EDRate_AfterUpdate()

Me.FrmWorkProduction_subform!DRate = Me.EDRate

End Sub

All I am trying to do is do the something but have it in separate form. I do not want to have the text field showing on the Main Form. Does that make sense?

Bob thanks again for the quick reply
 

boblarson

Smeghead
Local time
Yesterday, 23:21
Joined
Jan 12, 2001
Messages
32,059
You don't have to have it showing to refer to it. So, again

Me.FrmWorkProduction_subform.Form.DRate = Me.EDRate

And, are you sure that the name of the subform control actually has the underscore, or does it have a space (the default, unfortunately, is a space). If there is a space then it would be

Me.Controls("FrmWorkProduction subform").Form.DRate = Me.EDRate
 

Users who are viewing this thread

Top Bottom