G
Guest
Hello,
In short:
I can't get a popup menu button to execute a VBA function on a subform. How
can I achieve this?
Full story:
I have a subform which I reuse in several places. It's a datasheetview with
15+ columns. To make this usable I would like to offer the user the
possibility to select from three pre-defined sets of columns.
To allow the user to make this selection I made a popup menu for the subform
with three buttons and set the buttons 'On Action' like so:
=ShowColumns("A")
=ShowColumns("E")
=ShowColumns("F")
and a public function ShowColumns(choice as String) on the subform
This works very well if the subform is not used as a subform but as a normal
form. If used as a subform, Access reports that it cannot find the requested
function when the popup menubutton is clicked.
I suppose this is because the subform is not added to the Applaction.Forms
collection and therefor the function is not globally available or something.
Ofcourse I could use a global function which goes through all open forms
looking for the right subform and then passes the function on... But I'd like
it easer than that.
Any ideas anyone?
Kind regards,
Ries Spruit
In short:
I can't get a popup menu button to execute a VBA function on a subform. How
can I achieve this?
Full story:
I have a subform which I reuse in several places. It's a datasheetview with
15+ columns. To make this usable I would like to offer the user the
possibility to select from three pre-defined sets of columns.
To allow the user to make this selection I made a popup menu for the subform
with three buttons and set the buttons 'On Action' like so:
=ShowColumns("A")
=ShowColumns("E")
=ShowColumns("F")
and a public function ShowColumns(choice as String) on the subform
This works very well if the subform is not used as a subform but as a normal
form. If used as a subform, Access reports that it cannot find the requested
function when the popup menubutton is clicked.
I suppose this is because the subform is not added to the Applaction.Forms
collection and therefor the function is not globally available or something.
Ofcourse I could use a global function which goes through all open forms
looking for the right subform and then passes the function on... But I'd like
it easer than that.
Any ideas anyone?
Kind regards,
Ries Spruit