Shared Module string

A

Avi

hello,

how can i use the same module to perform the same actions
on multiple reports... the on activate event calls this
module that hides extra fields based on the users size
grade... for example, if the part has 3 sizes only 3 of
the 24 fields will show up.... I have crated reports
that allow more 'real-estate' for text... and if
confronted with a 5 sizes on a 6 field report... be able
to hide field 6, but use the module on ALL reports
without re-writting the moduel 12 times....

the module looks like this

Function NoGrade()
reports!rpt_sizereport_4.grade6.visible = false
end function

i want to be able to do this...

Function NoGrade(strName as string)
reports!" & strName & ".grade6.visible = false
end function

so that 'strNAme' can be any of the 4 new reports to make
the string read:

reports!rpt_sizereport_6.grade6.visible = false

and have it work!


sorry for the confusion, but hopefully someone can
straigtem me out!

Avi.
 
M

Marshall Barton

Avi said:
how can i use the same module to perform the same actions
on multiple reports... the on activate event calls this
module that hides extra fields based on the users size
grade... for example, if the part has 3 sizes only 3 of
the 24 fields will show up.... I have crated reports
that allow more 'real-estate' for text... and if
confronted with a 5 sizes on a 6 field report... be able
to hide field 6, but use the module on ALL reports
without re-writting the moduel 12 times....

the module looks like this

Function NoGrade()
reports!rpt_sizereport_4.grade6.visible = false
end function

i want to be able to do this...

Function NoGrade(strName as string)
reports!" & strName & ".grade6.visible = false
end function

so that 'strNAme' can be any of the 4 new reports to make
the string read:


You can refer to items in any collection by using the item's
index. Most collections use the name of the item as its
string index. This means that you can use the syntax:

Reports(strName).grade6.visible = false
 

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