PDA

View Full Version : Subform Value



brorick
12-11-2009, 05:55 PM
If I pull up the subform by itself I know this piece of code will work, but it won't work when the main form is open.

Srt = Forms("SubFrmA_FlexReports")("cboGroup_" & Cnt).Value


This is what I have so far. I am attempting to capture a value on a subform. I have a value on a subform I need to capture and I know the reference to the field is accurate. The problem is I can't figure out how to add .value at the end of the Srf= statement on the code at the bottom.


Dim Srf As Variant
Dim Cnt As Long

For Cnt = 0 To 2
Srf = Forms!Frm_MainPage.subformcontrol.Form.cboGroup_ & Cnt

Next


:help Any help would be greatly appreciated. Thank you.

orange
12-12-2009, 06:16 AM
If I pull up the subform by itself I know this piece of code will work, but it won't work when the main form is open.

Srt = Forms("SubFrmA_FlexReports")("cboGroup_" & Cnt).Value


This is what I have so far. I am attempting to capture a value on a subform. I have a value on a subform I need to capture and I know the reference to the field is accurate. The problem is I can't figure out how to add .value at the end of the Srf= statement on the code at the bottom.


Dim Srf As Variant
Dim Cnt As Long

For Cnt = 0 To 2
Srf = Forms!Frm_MainPage.subformcontrol.Form.cboGroup_ & Cnt

Next


:help Any help would be greatly appreciated. Thank you.

What error are you getting?
Have you looked at
http://support.microsoft.com/kb/113352

OBP
12-12-2009, 08:21 AM
Where are you trying to capture the subform value from, the Main Form or another form all together?