Hi! All, I'm a novice programmer, and the subject above doesn't really describe my problem fully. I work in a company which uses lots of database functions. I was asked to create an access report which acts as a template for the company's product sample. In this report, I have a Main Report (Main_NEW_NEWFORMAT) with several subreports in it (these subreports themselves have 1-2 level of sub-subreports in them). I have a main Form, which connects to any database that I point to and retrieves "Library Name" and "Process Name" from there. I'm almost done with this microsoft access "template" and had to do considerable amount of VB-Scripting.
My problem started when my boss wanted me to put images in the subreports, which were visible only if it matched the keyword criteria(dbo_T_PD_PROCESS_ELEMENT.C_Name). I have posted the sample code below so u can see exactly what i'm talking about. I can show the images when I put the coding ad view it form the subreport itself, but have a problem when i try to run that code from the Main Report, It gives me an error, saying that "You entered an expression which has an invalid reference to the property Form/Report". here is what the code looks like:
1) from Subreport:
'Design and Build
If Reports![PHASE_NEWFORMAT_R]![dbo_T_PD_PROCESS_ELEMENT.C_NAME] = "Design and Build" Then
Reports![PHASE_NEWFORMAT_R]![phase_Design_Build_Process].Visible = True
Else
Reports![PHASE_NEWFORMAT_R]![phase_Design_Build_Process].Visible = False
EndIf
2) from Main Report (erronous):
'Design and Build
If Reports![Main_NEW_NEWFORMAT]![PHASE_NEWFORMAT_R]![dbo_T_PD_PROCESS_ELEMENT.C_NAME] = "Design and Build" Then
Reports![Main_NEW_NEWFORMAT]![PHASE_NEWFORMAT_R]![phase_Design_Build_Process].Visible = True
Else
Reports![Main_NEW_NEWFORMAT]![PHASE_NEWFORMAT_R]![phase_Design_Build_Process].Visible = False
End If
I will be very thakful to whoever solves this problem, Please help me, I'm badly stuck at this point. thank you very much
Ash
My problem started when my boss wanted me to put images in the subreports, which were visible only if it matched the keyword criteria(dbo_T_PD_PROCESS_ELEMENT.C_Name). I have posted the sample code below so u can see exactly what i'm talking about. I can show the images when I put the coding ad view it form the subreport itself, but have a problem when i try to run that code from the Main Report, It gives me an error, saying that "You entered an expression which has an invalid reference to the property Form/Report". here is what the code looks like:
1) from Subreport:
'Design and Build
If Reports![PHASE_NEWFORMAT_R]![dbo_T_PD_PROCESS_ELEMENT.C_NAME] = "Design and Build" Then
Reports![PHASE_NEWFORMAT_R]![phase_Design_Build_Process].Visible = True
Else
Reports![PHASE_NEWFORMAT_R]![phase_Design_Build_Process].Visible = False
EndIf
2) from Main Report (erronous):
'Design and Build
If Reports![Main_NEW_NEWFORMAT]![PHASE_NEWFORMAT_R]![dbo_T_PD_PROCESS_ELEMENT.C_NAME] = "Design and Build" Then
Reports![Main_NEW_NEWFORMAT]![PHASE_NEWFORMAT_R]![phase_Design_Build_Process].Visible = True
Else
Reports![Main_NEW_NEWFORMAT]![PHASE_NEWFORMAT_R]![phase_Design_Build_Process].Visible = False
End If
I will be very thakful to whoever solves this problem, Please help me, I'm badly stuck at this point. thank you very much
Ash