PDA

View Full Version : Populate a subform from separate form



jwd0695
11-26-2012, 09:26 AM
Just a heads up, I have posted this in another posting, but having problems accessing my old account, so sorry for the repeat.

I have a Form which is called FrmA and on that FrmA. I also have a subform called subfrm1 and that subfrm1; I have a text field called Txt1.

What I would like to do is populate FrmA ,subfrm1 and text field Txt1, from another Form called FrmB.

Overview:
I have Form will all Employee hiring information and in that information form, I have field that reference what I am going to pay his hourly wages as well other information. I just want to be able to enter the information only one time in the subfrm1, due to I will be adding how many items he will be completing and I don’t want to be adding his wages every time.

Anyone have an idea how I can go about this. Not good at all in VBA.

The best I have so far is using the “After Update” event in FrmA. But that looks a little ugly and I really don’t like that way of doing it.

If you have a better way, please let me know.

Thanks for taking the time to read, view, and suggest any other Ideas

orange
11-27-2012, 05:36 PM
This will show you the form-subform-control syntax
http://access.mvps.org/access/forms/frm0031.htm

jrajul
12-01-2012, 11:01 AM
Add this into the afterUpdate event for the textbox.


Forms!frmA.Controls![Name of subform control].Form.Controls!Txt1 = TxtB

Remember that the frame inside FrmA that holds subfrm1 (the "subform" control) may have its own name like child0.