Question : Building a form/SubForm reference

Good afternoon Experts,

Here is a FOR NEXT loop I use to put values back to a Form I have referenced:  The frm refers to the Form.  Ctl refers to the control.  ifv refers to the particular column in the list I want to return.

My question is how do I modify this loop to refer back to a subform and not the Form?
Code Snippet:
1:
2:
3:
4:
5:
6:
'For iCount = 1 To iFields + 2 Step 2
       '    ifv = fncGetFieldValue(iCount)
       '    frm = fncGetFormString
       '    ctl = fncGetFieldString(iCount)
       '    Forms(frm).Controls(ctl).Value = Me.ListBox_SiteListView.Column(ifv, iIndex)
       'Next iCount

Answer : Building a form/SubForm reference

Hi Peter...you're going to have to use the Parent form's name in the definition of frm

Normally this reads this way

SET Frm = Forms("MainForm")("Subform").Form

What does your fncGetFormString look like?

J
Random Solutions  
 
programming4us programming4us