Re: Active Visual Basic Module

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Marshall Barton (marshbarton_at_wowway.com)
Date: 05/15/04


Date: Sat, 15 May 2004 12:17:43 -0500

LarBear wrote:

>I have a report that uses the same subreport multiple
>times on a page with different control names, ie: sub1,
>sub2, sub3. The subreport uses Visual Basic to populate
>the data in the subreport with a query. I need to find
>out if the Visual Basic code is currently running in sub1,
>sub2 or sub3 to provide different data.

Alex triggered an idea that you **might** be alble to take
advantage of if conditions are right. Your code in the
subform can check Parent.ActiveControl.Name to see which
subform control the active subform is contained in.

The problem with this is that, depending on where you want
to use that code, the main report may not be in a state that
has an active control. I.e. the subform's Open or Load
events. The Current event can be made to work if you skip
the first one or two times it's fired (before the mainform
completes its initialization).

-- 
Marsh
MVP [MS Access]


Relevant Pages

  • Re: Active Visual Basic Module
    ... The subreport uses Visual Basic to populate ... > out if the Visual Basic code is currently running in sub1, ... > sub2 or sub3 to provide different data. ...
    (microsoft.public.access.modulesdaovba)
  • Active Visual Basic Module
    ... I have a report that uses the same subreport multiple ... out if the Visual Basic code is currently running in sub1, ... sub2 or sub3 to provide different data. ...
    (microsoft.public.access.modulesdaovba)
  • Determining Subreport Parent Control
    ... I have a report that uses the same subreport multiple ... out if the Visual Basic code is currently running in sub1, ... sub2 or sub3 to provide different data. ...
    (microsoft.public.access.reports)
  • RE: *REPOST* If then Else Statment in Report
    ... "Duane Hookom" wrote: ... when a main report doesn't return records. ... Earlier as we found I was confused about the name of the control ... which is the name of the subreport as seen in the database window. ...
    (microsoft.public.access.reports)
  • RE: *REPOST* If then Else Statment in Report
    ... Earlier as we found I was confused about the name of the control ... with my report controls. ... "Duane Hookom" wrote: ... which is the name of the subreport as seen in the database window. ...
    (microsoft.public.access.reports)