G
Guest
I have created a main report with multiple possible subreports. I placed an
unbound subreport in the main form with ON OPEN code:
Private Sub Report_Open(Cancel As Integer)
dim strSUBREP as string
if [Forms]![FM_MAIN]![age] = "Yes" then
strSUBREP = "subreport1"
else
strSUBREP = "subreport2"
end if
Me.subreport = strSUBREP
exit sub
Am getting the error 2450: can't find 'FM_MAIN' refered to in a VB code.
FM_MAIN is the main form where the field age is located. I have tried using
Forms!FM_MAIN.age but still of no use. What should i do? Thanks in advance!
unbound subreport in the main form with ON OPEN code:
Private Sub Report_Open(Cancel As Integer)
dim strSUBREP as string
if [Forms]![FM_MAIN]![age] = "Yes" then
strSUBREP = "subreport1"
else
strSUBREP = "subreport2"
end if
Me.subreport = strSUBREP
exit sub
Am getting the error 2450: can't find 'FM_MAIN' refered to in a VB code.
FM_MAIN is the main form where the field age is located. I have tried using
Forms!FM_MAIN.age but still of no use. What should i do? Thanks in advance!