My requirement is to clone entire form which consist of many subforms and child control in form into similar set for form and subform with child controls.
I am copying the values from one form to another like below:
Form_frm_newForm.controlName.Value = Form_frm_oldForm.controlName
The above code works fine for the controls in the form. However there is one child control in the form which has a subform. The subform is in the datasheet view and may have multiple rows.
I tried the code below to get the values:
Form_frm_newForm.Child285.Controls("Cntrl1") = rs("Cntrl1")
Form_frm_newForm.Child285.Controls("cntrl2") = rs("cntrl2")
rs("Cntrl1") and rs("cntrl2") is values fetched from the query in a loop
The issue is while assigning values in this manner, only the last record is copied and displayed on the form, whereas what I need is as many records as are returned by the query.
I would appreciate if experts could help me with this and I hope I am able to explain my query.
I am copying the values from one form to another like below:
Form_frm_newForm.controlName.Value = Form_frm_oldForm.controlName
The above code works fine for the controls in the form. However there is one child control in the form which has a subform. The subform is in the datasheet view and may have multiple rows.
I tried the code below to get the values:
Form_frm_newForm.Child285.Controls("Cntrl1") = rs("Cntrl1")
Form_frm_newForm.Child285.Controls("cntrl2") = rs("cntrl2")
rs("Cntrl1") and rs("cntrl2") is values fetched from the query in a loop
The issue is while assigning values in this manner, only the last record is copied and displayed on the form, whereas what I need is as many records as are returned by the query.
I would appreciate if experts could help me with this and I hope I am able to explain my query.