Active Visual Basic Module

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.
 
A

Alex Dybenko

you can try to find this via me.parent.name or me.parent.control.name, debug
window will help you to get exact expression
 
M

Marshall Barton

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).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top