Active Visual Basic Module

  • Thread starter Thread starter LarBear
  • Start date Start date
L

LarBear

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.

Thanks for any suggestions.
 
you can try to find this via me.parent.name or me.parent.control.name, debug
window will help you to get exact expression
 
LarBear said:
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).
 
Back
Top