Modifying On Format Code

  • Thread starter Thread starter JohnB
  • Start date Start date
J

JohnB

Hi. I was getting some help from AlCamp on this but we
seem to have disconnected our conversation.

I wonder if anyone else can help me modify some On Format
code I have in a Reports section. The following code
controls the visibility of rptSubreport depending on the
content of field called Status in the main Reports record
source. Ive quoted it here from memory so please excuse
any minor syntax errors - it does work in my db.

If IsNot IsNull Me!Status Then
Me!rptSubreport.Visible = True
Else Me!rptSubreport.Visible = False
End If

Essentially I want to modify this code so that it looks
at a field called Student thats in the rptSubreports
record source, not in the main reports record source. What
changes would I need to make to the first line of code?

Thanks, JohnB
 
JohnB said:
I wonder if anyone else can help me modify some On Format
code I have in a Reports section. The following code
controls the visibility of rptSubreport depending on the
content of field called Status in the main Reports record
source. Ive quoted it here from memory so please excuse
any minor syntax errors - it does work in my db.

If IsNot IsNull Me!Status Then
Me!rptSubreport.Visible = True
Else Me!rptSubreport.Visible = False
End If

Essentially I want to modify this code so that it looks
at a field called Student thats in the rptSubreports
record source, not in the main reports record source. What
changes would I need to make to the first line of code?


Me!rptSubreport.Visible = _
Not IsNull(Me!rptSubreport.Report!Student)
 
Thanks Marsh.

Just two questions - your code has slipped oddly over two
lines with an underscore at the end of the first one. Is
it exactly as you intended? I presume I should put it in
as one line without the underscore.

Also, does your code replace all of mine? ie does it make
rptSubreport visable only when field Student has content?

Thanks again for the help. JohnB
 
Hi Marsh. No need to reply to my last post. All sorted
now. Thanks for the help, JohnB
 
Back
Top