Optional subreport?

M

MarianneZ

I have a report where part of the data is sensitive. I call the report from a
form where the user enters a password to be able to see the sensitive data. I
assumed the best way to do this was to put the sensitive stuff in a subreport
and only make it visible when appropriate. Strictly speaking, there's only
data from the current record in the main report, no connecting tables. Is a
subreport the best way to accomplish my goal?

Having assumed a subreport was the way to go, I created the report, than
dragged it onto my main report. I put all the controls in the (sub)report
header because there wasn't any detail. Was this correct?

I see no data in the subreport, just an empty box.
 
D

Duane Hookom

It sounds like you are suggesting there are no controls on your main report.
I think you want to put the non-sensitive stuff in the main report and the
sensitive in a subreport. You can then use the network login of the user with
some code to set the subreport to visible or invisible.
 
M

MarianneZ

No, there are controls on the main report, which I can see just fine. It's
the subreport I don't see. If the password is correct, I pass a flag in the
args to the Report program and in the Report_Load I set the subreport
visible, otherwise not visible, as follows

Me![Subreport name].Report.Visible = True

But maybe I need to issue a DoCmd.OpenReport? Does it matter that I
originally created the subreport as an independent entity?

And, yes, I will have to make my security more secure, but that will come
later.

Thanks for your help.
 
D

Duane Hookom

I would set a control (a subreport) visible in the On Format event of the
main report section containing the control. I would not use the Report_Load
event.

--
Duane Hookom
Microsoft Access MVP


MarianneZ said:
No, there are controls on the main report, which I can see just fine. It's
the subreport I don't see. If the password is correct, I pass a flag in the
args to the Report program and in the Report_Load I set the subreport
visible, otherwise not visible, as follows

Me![Subreport name].Report.Visible = True

But maybe I need to issue a DoCmd.OpenReport? Does it matter that I
originally created the subreport as an independent entity?

And, yes, I will have to make my security more secure, but that will come
later.

Thanks for your help.

Duane Hookom said:
It sounds like you are suggesting there are no controls on your main report.
I think you want to put the non-sensitive stuff in the main report and the
sensitive in a subreport. You can then use the network login of the user with
some code to set the subreport to visible or invisible.
 
M

MarianneZ

I tried setting the subreport visible in the main report's Detail_format.
Whereas previously I had an empty box, now I have no box. No data in either
case.

Duane Hookom said:
I would set a control (a subreport) visible in the On Format event of the
main report section containing the control. I would not use the Report_Load
event.

--
Duane Hookom
Microsoft Access MVP


MarianneZ said:
No, there are controls on the main report, which I can see just fine. It's
the subreport I don't see. If the password is correct, I pass a flag in the
args to the Report program and in the Report_Load I set the subreport
visible, otherwise not visible, as follows

Me![Subreport name].Report.Visible = True

But maybe I need to issue a DoCmd.OpenReport? Does it matter that I
originally created the subreport as an independent entity?

And, yes, I will have to make my security more secure, but that will come
later.

Thanks for your help.

Duane Hookom said:
It sounds like you are suggesting there are no controls on your main report.
I think you want to put the non-sensitive stuff in the main report and the
sensitive in a subreport. You can then use the network login of the user with
some code to set the subreport to visible or invisible.

--
Duane Hookom
Microsoft Access MVP


:

I have a report where part of the data is sensitive. I call the report from a
form where the user enters a password to be able to see the sensitive data. I
assumed the best way to do this was to put the sensitive stuff in a subreport
and only make it visible when appropriate. Strictly speaking, there's only
data from the current record in the main report, no connecting tables. Is a
subreport the best way to accomplish my goal?

Having assumed a subreport was the way to go, I created the report, than
dragged it onto my main report. I put all the controls in the (sub)report
header because there wasn't any detail. Was this correct?

I see no data in the subreport, just an empty box.
 
D

Duane Hookom

What happens if you remove all code so the subreport stays visible?
Do you have anything in the Link Master/Child properties of the subreport
control?

--
Duane Hookom
Microsoft Access MVP


MarianneZ said:
I tried setting the subreport visible in the main report's Detail_format.
Whereas previously I had an empty box, now I have no box. No data in either
case.

Duane Hookom said:
I would set a control (a subreport) visible in the On Format event of the
main report section containing the control. I would not use the Report_Load
event.

--
Duane Hookom
Microsoft Access MVP


MarianneZ said:
No, there are controls on the main report, which I can see just fine. It's
the subreport I don't see. If the password is correct, I pass a flag in the
args to the Report program and in the Report_Load I set the subreport
visible, otherwise not visible, as follows

Me![Subreport name].Report.Visible = True

But maybe I need to issue a DoCmd.OpenReport? Does it matter that I
originally created the subreport as an independent entity?

And, yes, I will have to make my security more secure, but that will come
later.

Thanks for your help.

:

It sounds like you are suggesting there are no controls on your main report.
I think you want to put the non-sensitive stuff in the main report and the
sensitive in a subreport. You can then use the network login of the user with
some code to set the subreport to visible or invisible.

--
Duane Hookom
Microsoft Access MVP


:

I have a report where part of the data is sensitive. I call the report from a
form where the user enters a password to be able to see the sensitive data. I
assumed the best way to do this was to put the sensitive stuff in a subreport
and only make it visible when appropriate. Strictly speaking, there's only
data from the current record in the main report, no connecting tables. Is a
subreport the best way to accomplish my goal?

Having assumed a subreport was the way to go, I created the report, than
dragged it onto my main report. I put all the controls in the (sub)report
header because there wasn't any detail. Was this correct?

I see no data in the subreport, just an empty box.
 
M

MarianneZ

Did I make clear that the data in the detail section of the main report and
the data in the subreport are actually from the same record in the same
table? That's why I was wondering if a subreport is the appropriate tool for
this job. It seemed the easiest way to address a collection of fields and
make the collection visible or not.

However, I have, with your help, progressed to seeing the subreport.
Bringing new problems, which I will address in another question (or
questions) as needed.

Thanks again for your help.



Duane Hookom said:
What happens if you remove all code so the subreport stays visible?
Do you have anything in the Link Master/Child properties of the subreport
control?

--
Duane Hookom
Microsoft Access MVP


MarianneZ said:
I tried setting the subreport visible in the main report's Detail_format.
Whereas previously I had an empty box, now I have no box. No data in either
case.

Duane Hookom said:
I would set a control (a subreport) visible in the On Format event of the
main report section containing the control. I would not use the Report_Load
event.

--
Duane Hookom
Microsoft Access MVP


:

No, there are controls on the main report, which I can see just fine. It's
the subreport I don't see. If the password is correct, I pass a flag in the
args to the Report program and in the Report_Load I set the subreport
visible, otherwise not visible, as follows

Me![Subreport name].Report.Visible = True

But maybe I need to issue a DoCmd.OpenReport? Does it matter that I
originally created the subreport as an independent entity?

And, yes, I will have to make my security more secure, but that will come
later.

Thanks for your help.

:

It sounds like you are suggesting there are no controls on your main report.
I think you want to put the non-sensitive stuff in the main report and the
sensitive in a subreport. You can then use the network login of the user with
some code to set the subreport to visible or invisible.

--
Duane Hookom
Microsoft Access MVP


:

I have a report where part of the data is sensitive. I call the report from a
form where the user enters a password to be able to see the sensitive data. I
assumed the best way to do this was to put the sensitive stuff in a subreport
and only make it visible when appropriate. Strictly speaking, there's only
data from the current record in the main report, no connecting tables. Is a
subreport the best way to accomplish my goal?

Having assumed a subreport was the way to go, I created the report, than
dragged it onto my main report. I put all the controls in the (sub)report
header because there wasn't any detail. Was this correct?

I see no data in the subreport, just an empty box.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top