Macro/RunCode - referencing a listbox on a subform

D

David Mueller

I have a shortcut menu on a listbox that calls a macro. The macro passes the
listbox to a function via the RunCode command.

This works fine when my form is not a subform, but it doesn't work when I
place my form on another form (where it needs to be).

I've tried using [forms]![mainform]![subform]!listbox and a million other
combinations, but nothing is working.

There must be something tricky about sending a listbox, or other control
value to a macro when the macro is called from a subform, no?

Thanks.
 
D

David Mueller

Yep, that's two for two... I'm answering my own questions like crazy!

In my expression, I was using the form name of the subform, not it's name as
it sat on the main form.

it works now.
 

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