473,543 Members | 2,018 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 11731

"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
3566
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...
3
12102
by: Melissa | last post by:
What specifically causes the Format event of a report's section to fire? Thanks! Melissa
1
5746
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...
4
1594
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
3142
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...
0
1608
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...
7
13357
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
4435
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 -...
0
7351
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
1
7350
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...
0
7691
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5887
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...
1
5276
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...
0
3392
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...
0
3392
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1819
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
1
973
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.