[AccessD] 3 subreports in detail section - show only one?

Joe Rojas JRojas at tnco-inc.com
Tue May 6 10:03:16 CDT 2003


Yep, that was it.

Thank you!

-----Original Message-----
From: Gustav Brock [mailto:gustav at cactus.dk]
Sent: Tuesday, May 06, 2003 10:47 AM
To: accessd at databaseadvisors.com
Subject: Re: [AccessD] 3 subreports in detail section - show only one?

Hi Joe

Wouldn't it be the controls and not the subforms to hide:

>         Me.tblBarrel_subreport.Visible = True
>         Me.tblSandBlast_subreport.Visible = False
>         Me.tblSweco_subreport.Visible = False

/gustav


> Hello All,

> (Access 2000)

> I have a report that has 3 subreports in it detail section. Each record in
> the data source of my report only links up to one of the subreports. The
> subreport that it links up to varies from record to record. I know which
> subreport it is linked up to via a field in my main report data source
> called 'machine'.

> Is it possible to hide 2 of the 3 subreports and show the 3rd for each
> detail section? Meaning that on a given report that has 3 records in the
> main report would have a detail section showing: subreport1 for record1
and
> hide subreport2 and subreport3, show subreport3 for record2 and hide
> subreport1 and subreport2, ...? (there could be any combination here)

> I tried putting this code into the detail_format section:

> Select Case Me.[Machine]
>     Case 1, 2, 5, 6, 7, 8
>         Me.tblBarrel_subreport.Form.Visible = True
>         Me.tblSandBlast_subreport.Form.Visible = False
>         Me.tblSweco_subreport.Form.Visible = False
>     Case 3, 4
>         Me.tblBarrel_subreport.Form.Visible = False
>         Me.tblSandBlast_subreport.Form.Visible = False
>         Me.tblSweco_subreport.Form.Visible = True
>     Case 9, 10, 11, 12, 13
>         Me.tblBarrel_subreport.Form.Visible = False
>         Me.tblSandBlast_subreport.Form.Visible = True
>         Me.tblSweco_subreport.Form.Visible = False
>     Case Else
>         MsgBox "Machine not recognized!"
>         DoCmd.Close acReport, Me.Name
> End Select


> As I traced through the code the report displays a blank preview as soon
as
> it hits the first *.Visible line and the causes Access to crash.

> Thanks!

> Joe Rojas
> jrojas at tnco-inc.com

_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com



This electronic transmission is strictly confidential to TNCO, Inc. and
intended solely for the addressee. It may contain information which is
covered by legal, professional, or other privileges. If you are not the
intended addressee, or someone authorized by the intended addressee to
receive transmissions on behalf of the addressee, you must not retain,
disclose in any form, copy, or take any action in reliance on this
transmission. If you have received this transmission in error, please notify
the sender as soon as possible and destroy this message. While TNCO, Inc.
uses virus protection, the recipient should check this email and any
attachments for the presence of viruses. TNCO, Inc. accepts no liability for
any damage caused by any virus transmitted by this email.


More information about the AccessD mailing list