passing form data onto vba in a macro

M

Mat Child

Hi,

I currently use a method to open multiple copies of the same form to be able
to view multiple records at the same time (Many thanks go to Mr Allen Browne
for how to do this).
On the form there are several buttons with VBA code behind them. In order to
make sure the code operates on the correct instance of the form I pass the
HWND value through
eg
On_Call (me.hwnd)

the On_Call sub then loops through the open forms and only continues with
it's actions when it finds a match with the HWND passed into it.

This works great however, I want to set up a context menu. Menu's only use
macros and while i can use the RUNCODE action, how can i get the HWND value
into the macro?

I tried using me.hwnd in the parenthesis, but as expected it generates an
error stating the object doesn't contain 'me'.

Is there any other way of getting the hwnd value into the macro to pass onto
the vba code?
Many thanks
 

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