Results 1 to 8 of 8
  1. #1
    Callahan is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Jul 2011
    Posts
    25

    subreport problem

    I have a subreport that works fine on it's own, but when I try to use it as a subreport (within a regular report), it does not work.


    The visual basic code that processes some controls on the subreport reports an error saying the subreport does not exist.

    The code is fired off on a format event.

    Thanks

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    If the mystery code contains a reference to the report, it would change when it's used as a subreport. This is for forms, but the same syntax would apply, other than "Reports" and "Report" instead of "Forms" and "Form":

    Forms Refer to Form and Subform properties and controls
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    And FYI, I deleted your duplicate thread. There's no need to post the same question twice.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  4. #4
    Callahan is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Jul 2011
    Posts
    25
    Thanks.

    So I need to change code like [code]If Me![SubReporttesGOOD].[Controls]![Text31] <> 0 Then
    Me![SubReporttesGOOD].[Controls]![Text72] = [Reports]![SubReporttesGOOD]![Text31]
    End If[endcode]?

  5. #5
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    Code with "Me" is probably okay, code with "Reports" is probably not.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  6. #6
    Callahan is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Jul 2011
    Posts
    25
    Thanks for your assistance. Sorry about the duplicate thread, I was trying to get it into the right forum (Reports), then delete the original in the Forms forum. I am struggeling a bit on the properties and controls, though it could be that my problem lies within an unbound control. Are unbound controls not allowed in a subreport that is called from a main report??

  7. #7
    Callahan is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Jul 2011
    Posts
    25
    Thank you sir. The Me syntax worked, ... for ME!!

    This is a great forum, and thanks again!!

  8. #8
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    Glad you got it sorted!
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 1
    Last Post: 04-15-2013, 10:02 AM
  2. subreport length problem
    By stephenaa5 in forum Reports
    Replies: 4
    Last Post: 09-17-2012, 10:06 PM
  3. SubReport Problem
    By 97rstd in forum Reports
    Replies: 3
    Last Post: 11-18-2011, 03:31 PM
  4. Replies: 1
    Last Post: 01-10-2011, 01:08 PM
  5. SubReport Problem.
    By gianfrancom in forum Reports
    Replies: 3
    Last Post: 04-26-2010, 02:43 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums