473,836 Members | 1,478 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Hide report (detail) section via Code at Run time

Hi -
Is it possible to hide the detail section of a report at run time?

I have a report that prints all details, with summary lines. The user
would like the report ALSO with just summary lines.

It seems the simplest thing is to run the code (see below) once with
the detail section showing, and a second time hiding the detail
section. I can't figure out the code to do that and don't see it
posted.

Thanks -
Sara

strDocName = "rptPaymentDueD ateandDollars"

strStepErrorMsg = "Tell IT there was a problem with Details
Committed Dollars Report"

strFile = strDocName & ".snp"
strPathAndFile = strPath & strFile
DoCmd.OutputTo acOutputReport, strDocName, "snapshot format",
_
strPathAndFile ' works fine

strStepErrorMsg = "Tell IT there was a problem with Summary
Committed Dollars Report"

strFile = strDocName & ".snp"
strPathAndFile = strPath & strFile

' Print same report again, but hide the Detail section

DoCmd.OpenRepor t strDocName, acViewPreview, , _
"rptPaymentDueD ateandDollars.D etail.Visible = False" '
gives error

DoCmd.OutputTo acOutputReport, strDocName, "snapshot format",
_
strPathAndFile

DoCmd.Close acReport, strDocName

Sep 7 '07 #1
10 11778

"sara" <sa*******@yaho o.comwrote in message
news:11******** *************@r 34g2000hsd.goog legroups.com...
Hi -
Is it possible to hide the detail section of a report at run time?

I have a report that prints all details, with summary lines. The user
would like the report ALSO with just summary lines.

It seems the simplest thing is to run the code (see below) once with
the detail section showing, and a second time hiding the detail
section. I can't figure out the code to do that and don't see it
posted.

Thanks -
Sara

strDocName = "rptPaymentDueD ateandDollars"

strStepErrorMsg = "Tell IT there was a problem with Details
Committed Dollars Report"

strFile = strDocName & ".snp"
strPathAndFile = strPath & strFile
DoCmd.OutputTo acOutputReport, strDocName, "snapshot format",
_
strPathAndFile ' works fine

strStepErrorMsg = "Tell IT there was a problem with Summary
Committed Dollars Report"

strFile = strDocName & ".snp"
strPathAndFile = strPath & strFile

' Print same report again, but hide the Detail section

DoCmd.OpenRepor t strDocName, acViewPreview, , _
"rptPaymentDueD ateandDollars.D etail.Visible = False" '
gives error

DoCmd.OutputTo acOutputReport, strDocName, "snapshot format",
_
strPathAndFile

DoCmd.Close acReport, strDocName
Add the following to the report's open event.

If MsgBox("Show detail and summary?", vbYesNo, "Confirm") = vbNo Then
Me.Section(0).V isible = False
End If

The user will need to respond each time the report is opened, the default is
to show the detail section.
Sep 7 '07 #2
On Sep 7, 1:27 pm, "paii, Ron" <n...@no.comwro te:
"sara" <saraqp...@yaho o.comwrote in message

news:11******** *************@r 34g2000hsd.goog legroups.com...


Hi -
Is it possible to hide the detail section of a report at run time?
I have a report that prints all details, with summary lines. The user
would like the report ALSO with just summary lines.
It seems the simplest thing is to run the code (see below) once with
the detail section showing, and a second time hiding the detail
section. I can't figure out the code to do that and don't see it
posted.
Thanks -
Sara
strDocName = "rptPaymentDueD ateandDollars"
strStepErrorMsg = "Tell IT there was a problem with Details
Committed Dollars Report"
strFile = strDocName & ".snp"
strPathAndFile = strPath & strFile
DoCmd.OutputTo acOutputReport, strDocName, "snapshot format",
_
strPathAndFile ' works fine
strStepErrorMsg = "Tell IT there was a problem with Summary
Committed Dollars Report"
strFile = strDocName & ".snp"
strPathAndFile = strPath & strFile
' Print same report again, but hide the Detail section
DoCmd.OpenRepor t strDocName, acViewPreview, , _
"rptPaymentDueD ateandDollars.D etail.Visible = False" '
gives error
DoCmd.OutputTo acOutputReport, strDocName, "snapshot format",
_
strPathAndFile
DoCmd.Close acReport, strDocName

Add the following to the report's open event.

If MsgBox("Show detail and summary?", vbYesNo, "Confirm") = vbNo Then
Me.Section(0).V isible = False
End If

The user will need to respond each time the report is opened, the default is
to show the detail section.- Hide quoted text -

- Show quoted text -

Is there any way to do it so the user doesn't have to respond? So it
automatically creates the two reports from the one definition -
Detail, summary?

thanks -
Sara

Sep 7 '07 #3
sara wrote:
On Sep 7, 1:27 pm, "paii, Ron" <n...@no.comwro te:
>>"sara" <saraqp...@yaho o.comwrote in message

news:11****** *************** @r34g2000hsd.go oglegroups.com. ..

>>>Hi -
Is it possible to hide the detail section of a report at run time?
>>>I have a report that prints all details, with summary lines. The user
would like the report ALSO with just summary lines.
>>>It seems the simplest thing is to run the code (see below) once with
the detail section showing, and a second time hiding the detail
section. I can't figure out the code to do that and don't see it
posted.
>>>Thanks -
Sara
>> strDocName = "rptPaymentDueD ateandDollars"
>> strStepErrorMsg = "Tell IT there was a problem with Details
Committed Dollars Report"
>> strFile = strDocName & ".snp"
strPathAndFile = strPath & strFile
DoCmd.OutputTo acOutputReport, strDocName, "snapshot format",
_
strPathAndFile ' works fine
>> strStepErrorMsg = "Tell IT there was a problem with Summary
Committed Dollars Report"
>> strFile = strDocName & ".snp"
strPathAndFile = strPath & strFile
>>>' Print same report again, but hide the Detail section
>> DoCmd.OpenRepor t strDocName, acViewPreview, , _
"rptPaymentDueD ateandDollars.D etail.Visible = False" '
gives error
>> DoCmd.OutputTo acOutputReport, strDocName, "snapshot format",
_
strPathAndFile
>> DoCmd.Close acReport, strDocName

Add the following to the report's open event.

If MsgBox("Show detail and summary?", vbYesNo, "Confirm") = vbNo Then
Me.Section(0).V isible = False
End If

The user will need to respond each time the report is opened, the default is
to show the detail section.- Hide quoted text -

- Show quoted text -

Is there any way to do it so the user doesn't have to respond? So it
automatically creates the two reports from the one definition -
Detail, summary?

thanks -
Sara
Do it from the form that calls the report...if you have one. You can
give the options to print or preview, summary, detail, and any filters
from the form. In the OnOpen event of the report you can do whatever
setting you like.
Sep 7 '07 #4
On Sep 7, 2:44 pm, Salad <o...@vinegar.c omwrote:
sara wrote:
On Sep 7, 1:27 pm, "paii, Ron" <n...@no.comwro te:
>"sara" <saraqp...@yaho o.comwrote in message
>news:11******* **************@ r34g2000hsd.goo glegroups.com.. .
>>Hi -
Is it possible to hide the detail section of a report at run time?
>>I have a report that prints all details, with summary lines. The user
would like the report ALSO with just summary lines.
>>It seems the simplest thing is to run the code (see below) once with
the detail section showing, and a second time hiding the detail
section. I can't figure out the code to do that and don't see it
posted.
>>Thanks -
Sara
> strDocName = "rptPaymentDueD ateandDollars"
> strStepErrorMsg = "Tell IT there was a problem with Details
Committed Dollars Report"
> strFile = strDocName & ".snp"
strPathAndFile = strPath & strFile
DoCmd.OutputTo acOutputReport, strDocName, "snapshot format",
_
strPathAndFile ' works fine
> strStepErrorMsg = "Tell IT there was a problem with Summary
Committed Dollars Report"
> strFile = strDocName & ".snp"
strPathAndFile = strPath & strFile
>>' Print same report again, but hide the Detail section
> DoCmd.OpenRepor t strDocName, acViewPreview, , _
"rptPaymentDueD ateandDollars.D etail.Visible = False" '
gives error
> DoCmd.OutputTo acOutputReport, strDocName, "snapshot format",
_
strPathAndFile
> DoCmd.Close acReport, strDocName
>Add the following to the report's open event.
If MsgBox("Show detail and summary?", vbYesNo, "Confirm") = vbNo Then
Me.Section(0).V isible = False
End If
>The user will need to respond each time the report is opened, the default is
to show the detail section.- Hide quoted text -
>- Show quoted text -
Is there any way to do it so the user doesn't have to respond? So it
automatically creates the two reports from the one definition -
Detail, summary?
thanks -
Sara

Do it from the form that calls the report...if you have one. You can
give the options to print or preview, summary, detail, and any filters
from the form. In the OnOpen event of the report you can do whatever
setting you like.- Hide quoted text -

- Show quoted text -
I don't understand. I am doing this from the form. I just want the
user to choose an option on the form and have the report run twice -
once with the detail showing and once with it hidden. How do I "set"
the Detail.Visible to False for the second run? Maybe it can't be
done. Since the user Always wants the two reports to run, I don't
want to make him click twice or choose anything - just do what he
asked me to do.

Is it possible with no user intervention?

Sara

Sep 7 '07 #5
sara wrote:
On Sep 7, 2:44 pm, Salad <o...@vinegar.c omwrote:
>>sara wrote:
>>>On Sep 7, 1:27 pm, "paii, Ron" <n...@no.comwro te:
>>>>"sara" <saraqp...@yaho o.comwrote in message
>>>>news:11**** *************** **@r34g2000hsd. googlegroups.co m...
>>>>>Hi -
>Is it possible to hide the detail section of a report at run time?
>>>>>I have a report that prints all details, with summary lines. The user
>would like the report ALSO with just summary lines.
>>>>>It seems the simplest thing is to run the code (see below) once with
>the detail section showing, and a second time hiding the detail
>section. I can't figure out the code to do that and don't see it
>posted.
>>>>>Thanks -
>Sara
>>>> strDocName = "rptPaymentDueD ateandDollars"
>>>> strStepErrorMsg = "Tell IT there was a problem with Details
>Committe d Dollars Report"
>>>> strFile = strDocName & ".snp"
strPathAndFile = strPath & strFile
DoCmd.OutputTo acOutputReport, strDocName, "snapshot format",
>_
strPathAndFile ' works fine
>>>> strStepErrorMsg = "Tell IT there was a problem with Summary
>Committe d Dollars Report"
>>>> strFile = strDocName & ".snp"
strPathAndFile = strPath & strFile
>>>>>' Print same report again, but hide the Detail section
>>>> DoCmd.OpenRepor t strDocName, acViewPreview, , _
"rptPaymentDueD ateandDollars.D etail.Visible = False" '
>gives error
>>>> DoCmd.OutputTo acOutputReport, strDocName, "snapshot format",
>_
strPathAndFile
>>>> DoCmd.Close acReport, strDocName
>>>>Add the following to the report's open event.
>>> If MsgBox("Show detail and summary?", vbYesNo, "Confirm") = vbNo Then
Me.Section(0).V isible = False
End If
>>>>The user will need to respond each time the report is opened, the default is
to show the detail section.- Hide quoted text -
>>>>- Show quoted text -
>>>Is there any way to do it so the user doesn't have to respond? So it
automaticall y creates the two reports from the one definition -
Detail, summary?
>>>thanks -
Sara

Do it from the form that calls the report...if you have one. You can
give the options to print or preview, summary, detail, and any filters
from the form. In the OnOpen event of the report you can do whatever
setting you like.- Hide quoted text -

- Show quoted text -


I don't understand. I am doing this from the form. I just want the
user to choose an option on the form and have the report run twice -
once with the detail showing and once with it hidden. How do I "set"
the Detail.Visible to False for the second run? Maybe it can't be
done. Since the user Always wants the two reports to run, I don't
want to make him click twice or choose anything - just do what he
asked me to do.

Is it possible with no user intervention?
I guess that's up to the designer and programmer. If that's what they
want, they need to code it to do so.

I like to give my users option. Like...print preview, send to printer.

You could give them additional options like Detail Report, Summary
Report, Both.

Maybe you only want records for an employee. Or records in a date range.

Now if printing both, create a field in your form. If detail, set the
txtbox to "Detail" then call the report. If Summary, set it to
"Summary" and call the report. The code in the report could check
If Forms!MyReport! TxtBox = "Detail" Then
ElseIf Forms!MyReport! TxtBox = "Summary"
Else
Endif

The user always wants to print both. I still say give an option group
and default to "Both".

Sara
Sep 7 '07 #6

"sara" <sa*******@yaho o.comwrote in message
news:11******** *************@y 42g2000hsy.goog legroups.com...
On Sep 7, 2:44 pm, Salad <o...@vinegar.c omwrote:
sara wrote:
On Sep 7, 1:27 pm, "paii, Ron" <n...@no.comwro te:
>>"sara" <saraqp...@yaho o.comwrote in message
>>news:11****** *************** @r34g2000hsd.go oglegroups.com. ..
>>>Hi -
>>>Is it possible to hide the detail section of a report at run time?
>>>I have a report that prints all details, with summary lines. The
user
>>>would like the report ALSO with just summary lines.
>>>It seems the simplest thing is to run the code (see below) once with
>>>the detail section showing, and a second time hiding the detail
>>>section. I can't figure out the code to do that and don't see it
>>>posted.
>>>Thanks -
>>>Sara
>> strDocName = "rptPaymentDueD ateandDollars"
>> strStepErrorMsg = "Tell IT there was a problem with Details
>>>Committed Dollars Report"
>> strFile = strDocName & ".snp"
>> strPathAndFile = strPath & strFile
>> DoCmd.OutputTo acOutputReport, strDocName, "snapshot format",
>>>_
>> strPathAndFile ' works fine
>> strStepErrorMsg = "Tell IT there was a problem with Summary
>>>Committed Dollars Report"
>> strFile = strDocName & ".snp"
>> strPathAndFile = strPath & strFile
>>>' Print same report again, but hide the Detail section
>> DoCmd.OpenRepor t strDocName, acViewPreview, , _
>> "rptPaymentDueD ateandDollars.D etail.Visible = False" '
>>>gives error
>> DoCmd.OutputTo acOutputReport, strDocName, "snapshot format",
>>>_
>> strPathAndFile
>> DoCmd.Close acReport, strDocName
>>Add the following to the report's open event.
> If MsgBox("Show detail and summary?", vbYesNo, "Confirm") = vbNo
Then
> Me.Section(0).V isible = False
> End If
>>The user will need to respond each time the report is opened, the
default is
>>to show the detail section.- Hide quoted text -
>>- Show quoted text -
Is there any way to do it so the user doesn't have to respond? So it
automatically creates the two reports from the one definition -
Detail, summary?
thanks -
Sara
Do it from the form that calls the report...if you have one. You can
give the options to print or preview, summary, detail, and any filters
from the form. In the OnOpen event of the report you can do whatever
setting you like.- Hide quoted text -

- Show quoted text -

I don't understand. I am doing this from the form. I just want the
user to choose an option on the form and have the report run twice -
once with the detail showing and once with it hidden. How do I "set"
the Detail.Visible to False for the second run? Maybe it can't be
done. Since the user Always wants the two reports to run, I don't
want to make him click twice or choose anything - just do what he
asked me to do.

Is it possible with no user intervention?

Sara
Replace msgbox with a reference to your form's control

If Forms![YourFormName]![YourControlName] = False Then
Me.Section(0).V isible = False
EndIf

OR

Me.Section(0).V isible = Forms![YourFormName]![YourControlName]
Sep 7 '07 #7
On Sep 7, 3:50 pm, "paii, Ron" <n...@no.comwro te:
"sara" <saraqp...@yaho o.comwrote in message

news:11******** *************@y 42g2000hsy.goog legroups.com...


On Sep 7, 2:44 pm, Salad <o...@vinegar.c omwrote:
sara wrote:
On Sep 7, 1:27 pm, "paii, Ron" <n...@no.comwro te:
>"sara" <saraqp...@yaho o.comwrote in message
>news:11******* **************@ r34g2000hsd.goo glegroups.com.. .
>>Hi -
>>Is it possible to hide the detail section of a report at run time?
>>I have a report that prints all details, with summary lines. The
user
>>would like the report ALSO with just summary lines.
>>It seems the simplest thing is to run the code (see below) once with
>>the detail section showing, and a second time hiding the detail
>>section. I can't figure out the code to do that and don't see it
>>posted.
>>Thanks -
>>Sara
> strDocName = "rptPaymentDueD ateandDollars"
> strStepErrorMsg = "Tell IT there was a problem with Details
>>Committed Dollars Report"
> strFile = strDocName & ".snp"
> strPathAndFile = strPath & strFile
> DoCmd.OutputTo acOutputReport, strDocName, "snapshot format",
>>_
> strPathAndFile ' works fine
> strStepErrorMsg = "Tell IT there was a problem with Summary
>>Committed Dollars Report"
> strFile = strDocName & ".snp"
> strPathAndFile = strPath & strFile
>>' Print same report again, but hide the Detail section
> DoCmd.OpenRepor t strDocName, acViewPreview, , _
> "rptPaymentDueD ateandDollars.D etail.Visible = False" '
>>gives error
> DoCmd.OutputTo acOutputReport, strDocName, "snapshot format",
>>_
> strPathAndFile
> DoCmd.Close acReport, strDocName
>Add the following to the report's open event.
If MsgBox("Show detail and summary?", vbYesNo, "Confirm") = vbNo
Then
Me.Section(0).V isible = False
End If
>The user will need to respond each time the report is opened, the
default is
>to show the detail section.- Hide quoted text -
>- Show quoted text -
Is there any way to do it so the user doesn't have to respond? So it
automatically creates the two reports from the one definition -
Detail, summary?
thanks -
Sara
Do it from the form that calls the report...if you have one. You can
give the options to print or preview, summary, detail, and any filters
from the form. In the OnOpen event of the report you can do whatever
setting you like.- Hide quoted text -
- Show quoted text -
I don't understand. I am doing this from the form. I just want the
user to choose an option on the form and have the report run twice -
once with the detail showing and once with it hidden. How do I "set"
the Detail.Visible to False for the second run? Maybe it can't be
done. Since the user Always wants the two reports to run, I don't
want to make him click twice or choose anything - just do what he
asked me to do.
Is it possible with no user intervention?
Sara

Replace msgbox with a reference to your form's control

If Forms![YourFormName]![YourControlName] = False Then
Me.Section(0).V isible = False
EndIf

OR

Me.Section(0).V isible = Forms![YourFormName]![YourControlName]- Hide quoted text -

- Show quoted text -
THANK YOU!!! This worked! I had a feeling it was simple, and it
was.

I just put the line Me.Section(0).V isible = False right above
printing the report again and it worked.

Many thanks!
Sara

Sep 7 '07 #8
On Sep 7, 3:50 pm, "paii, Ron" <n...@no.comwro te:
"sara" <saraqp...@yaho o.comwrote in message

news:11******** *************@y 42g2000hsy.goog legroups.com...


On Sep 7, 2:44 pm, Salad <o...@vinegar.c omwrote:
sara wrote:
On Sep 7, 1:27 pm, "paii, Ron" <n...@no.comwro te:
>"sara" <saraqp...@yaho o.comwrote in message
>news:11******* **************@ r34g2000hsd.goo glegroups.com.. .
>>Hi -
>>Is it possible to hide the detail section of a report at run time?
>>I have a report that prints all details, with summary lines. The
user
>>would like the report ALSO with just summary lines.
>>It seems the simplest thing is to run the code (see below) once with
>>the detail section showing, and a second time hiding the detail
>>section. I can't figure out the code to do that and don't see it
>>posted.
>>Thanks -
>>Sara
> strDocName = "rptPaymentDueD ateandDollars"
> strStepErrorMsg = "Tell IT there was a problem with Details
>>Committed Dollars Report"
> strFile = strDocName & ".snp"
> strPathAndFile = strPath & strFile
> DoCmd.OutputTo acOutputReport, strDocName, "snapshot format",
>>_
> strPathAndFile ' works fine
> strStepErrorMsg = "Tell IT there was a problem with Summary
>>Committed Dollars Report"
> strFile = strDocName & ".snp"
> strPathAndFile = strPath & strFile
>>' Print same report again, but hide the Detail section
> DoCmd.OpenRepor t strDocName, acViewPreview, , _
> "rptPaymentDueD ateandDollars.D etail.Visible = False" '
>>gives error
> DoCmd.OutputTo acOutputReport, strDocName, "snapshot format",
>>_
> strPathAndFile
> DoCmd.Close acReport, strDocName
>Add the following to the report's open event.
If MsgBox("Show detail and summary?", vbYesNo, "Confirm") = vbNo
Then
Me.Section(0).V isible = False
End If
>The user will need to respond each time the report is opened, the
default is
>to show the detail section.- Hide quoted text -
>- Show quoted text -
Is there any way to do it so the user doesn't have to respond? So it
automatically creates the two reports from the one definition -
Detail, summary?
thanks -
Sara
Do it from the form that calls the report...if you have one. You can
give the options to print or preview, summary, detail, and any filters
from the form. In the OnOpen event of the report you can do whatever
setting you like.- Hide quoted text -
- Show quoted text -
I don't understand. I am doing this from the form. I just want the
user to choose an option on the form and have the report run twice -
once with the detail showing and once with it hidden. How do I "set"
the Detail.Visible to False for the second run? Maybe it can't be
done. Since the user Always wants the two reports to run, I don't
want to make him click twice or choose anything - just do what he
asked me to do.
Is it possible with no user intervention?
Sara

Replace msgbox with a reference to your form's control

If Forms![YourFormName]![YourControlName] = False Then
Me.Section(0).V isible = False
EndIf

OR

Me.Section(0).V isible = Forms![YourFormName]![YourControlName]- Hide quoted text -

- Show quoted text -
I may have spoken too soon. What is happening when I run this from my
form, is that it's not hiding the detail section, but was hiding the
form section. (I figured out how to put that back). I don't know how
to reference the report to hide the section.

Code:
strFile = "Summary " & strDocName & ".snp"
strPathAndFile = strPath & strFile
Me.Section(0).V isible = False
DoCmd.OutputTo acOutputReport, strDocName, "snapshot format",
_
strPathAndFile

Forms![frmPrintPORepor ts].Section(0).Vis ible = True

I tried Reports!rptPaym entDueDateandDo llars.Section(0 ).Visible =
False
but I get an error messagy saying "rptPaymentDueD ateandDollars is
missing or misspelled"

Help!!!
Sara

Sep 7 '07 #9

"sara" <sa*******@yaho o.comwrote in message
news:11******** **************@ k79g2000hse.goo glegroups.com.. .
On Sep 7, 3:50 pm, "paii, Ron" <n...@no.comwro te:
"sara" <saraqp...@yaho o.comwrote in message

news:11******** *************@y 42g2000hsy.goog legroups.com...


On Sep 7, 2:44 pm, Salad <o...@vinegar.c omwrote:
sara wrote:
On Sep 7, 1:27 pm, "paii, Ron" <n...@no.comwro te:
>>"sara" <saraqp...@yaho o.comwrote in message
>>news:11****** *************** @r34g2000hsd.go oglegroups.com. ..
>>>Hi -
>>>Is it possible to hide the detail section of a report at run
time?
>>>I have a report that prints all details, with summary lines. The
user
>>>would like the report ALSO with just summary lines.
>>>It seems the simplest thing is to run the code (see below) once
with
>>>the detail section showing, and a second time hiding the detail
>>>section. I can't figure out the code to do that and don't see it
>>>posted.
>>>Thanks -
>>>Sara
>> strDocName = "rptPaymentDueD ateandDollars"
>> strStepErrorMsg = "Tell IT there was a problem with
Details
>>>Committed Dollars Report"
>> strFile = strDocName & ".snp"
>> strPathAndFile = strPath & strFile
>> DoCmd.OutputTo acOutputReport, strDocName, "snapshot
format",
>>>_
>> strPathAndFile ' works fine
>> strStepErrorMsg = "Tell IT there was a problem with
Summary
>>>Committed Dollars Report"
>> strFile = strDocName & ".snp"
>> strPathAndFile = strPath & strFile
>>>' Print same report again, but hide the Detail section
>> DoCmd.OpenRepor t strDocName, acViewPreview, , _
>> "rptPaymentDueD ateandDollars.D etail.Visible = False"
'
>>>gives error
>> DoCmd.OutputTo acOutputReport, strDocName, "snapshot
format",
>>>_
>> strPathAndFile
>> DoCmd.Close acReport, strDocName
>>Add the following to the report's open event.
> If MsgBox("Show detail and summary?", vbYesNo, "Confirm") =
vbNo
Then
> Me.Section(0).V isible = False
> End If
>>The user will need to respond each time the report is opened, the
default is
>>to show the detail section.- Hide quoted text -
>>- Show quoted text -
Is there any way to do it so the user doesn't have to respond? So
it
automatically creates the two reports from the one definition -
Detail, summary?
thanks -
Sara
Do it from the form that calls the report...if you have one. You
can
give the options to print or preview, summary, detail, and any
filters
from the form. In the OnOpen event of the report you can do
whatever
setting you like.- Hide quoted text -
- Show quoted text -
I don't understand. I am doing this from the form. I just want the
user to choose an option on the form and have the report run twice -
once with the detail showing and once with it hidden. How do I "set"
the Detail.Visible to False for the second run? Maybe it can't be
done. Since the user Always wants the two reports to run, I don't
want to make him click twice or choose anything - just do what he
asked me to do.
Is it possible with no user intervention?
Sara
Replace msgbox with a reference to your form's control

If Forms![YourFormName]![YourControlName] = False Then
Me.Section(0).V isible = False
EndIf

OR

Me.Section(0).V isible = Forms![YourFormName]![YourControlName]- Hide
quoted text -

- Show quoted text -

I may have spoken too soon. What is happening when I run this from my
form, is that it's not hiding the detail section, but was hiding the
form section. (I figured out how to put that back). I don't know how
to reference the report to hide the section.

Code:
strFile = "Summary " & strDocName & ".snp"
strPathAndFile = strPath & strFile
Me.Section(0).V isible = False
DoCmd.OutputTo acOutputReport, strDocName, "snapshot format",
_
strPathAndFile

Forms![frmPrintPORepor ts].Section(0).Vis ible = True

I tried Reports!rptPaym entDueDateandDo llars.Section(0 ).Visible =
False
but I get an error messagy saying "rptPaymentDueD ateandDollars is
missing or misspelled"

Help!!!
Sara
Put the code in the Open event of the Report, not the form. It will
reference the form for the true or false to display the detail.
Sep 10 '07 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
3580
by: John Baker | last post by:
Hi: Stuck on another thing. On a report I am creating, I want to make the detail section one line vertically. However, in design view, I click on the page Footer Bar ,grab it with the "double arrow and cross", and try to move it up and while it moves, as soon as I release it jumps back to its original position. For some reason the property "height" for the detail section is stuck at a minimum of .5833". The height will go LARGER but...
3
12169
by: Melissa | last post by:
What specifically causes the Format event of a report's section to fire? Thanks! Melissa
1
5775
by: Tom | last post by:
In the Developers Handbook, Getz provides a way to create a survey report that displays either a line, Yes/No or multiple choice for each question. It's done by placing three controls (one for each type of answer) in the report's detail section and then making the control appropriate for each question visible in the Format event of the detail section. Can this be simulated in a form? There's no Detail Format event for a form but can it be...
4
1609
by: Lyle Fairfield | last post by:
I had a Sproc which returned a field called Details. I had the Form Wizard create a continuous form with the Sproc as the RecordSource (as a shell for me to modify). I renamed the Details textbox to txtDetails. Except I didn't. I grabbed DETAIL from the pulldown and renamed it to TxtDetail.
4
3160
by: Mal Reeve | last post by:
Hello, I have a report that has only 2 levels of grouping. The detail section is simply 1 large block for a memo field. I am finding that on some occasions the report errors and generates hundreds (perhaps even an infinite loop...I have to break the system to stop the report generating) of pages. While I'm not 100% I think this may have something to do with the detail
0
1620
by: Tim Marshall | last post by:
Access 2003. A report of mine was hanging on print preview. It turned out the issue was a bound text box where the data was too big to fit all on one page. When I changed the "keep together" property for the detail section to NO, the report previewed and performed as expected. However, I'm now faced with a minor irritant I'd like to be able to deal with. Some other records with far less content in the text box at issue end up getting...
7
13427
by: NJonge01 | last post by:
Hi, I'd like to produce a report that basically looks like an excel printout. Description: Profile Print Report Detail Section with 3 bordered text boxes all text boxes are 'abutted' against each other (where one ends, the next begins) all text boxes have the 'can grow' property set to yes. Detail Section with 'can grown' = yes
2
4453
by: emckesso | last post by:
Hello, I need to create conditional formatting of a text box in the detail section of a report. The formatting is based on multiple parameters that are stored in a query. For example, pretend that = 50%, = 80%, and = 90%. I will check in the report against (from the query, but currently stored in a text box on the report via a Dlookup - textbox name is still ). If is less than then I want to compare the value of (another report...
0
9825
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10846
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10551
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10595
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9379
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7793
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6979
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5650
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4458
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.