Sending OpenArgs with Menu Bar

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,
I have one form that can be used in a couple of ways. The form is for
different types of meetings. I want to develop a custom menu bar that groups
tasks for the different meeting types. I then want to change things like the
filter depending on which menu bar option was selected. If I was using
command buttons or something, I could open the form using open args and then
perform a task based on the open args passed.

Is there a way to open a form from a custom menu bar and pass some argument
that can then be examined in the On Open event? Thank you.
Debbie
 
Sure, the only trick is that you "menu code" must be more generic.

Assuming you create menu bar, you can have that menu bar call YOUR custom
code.

In fact, lets pretend you have a command on a menu that is supposed to show
all invoices for that current customer you are looking at:


The menu button code can call any public function in your form...you can
thus put in the on-action setting for the menu

=ViewAllInvoices()


Now, in your form, you go:


public Function ViewAllInvoices

dim strWhere as string

strWhere = "Customer_id = " & me.CustID
docmd.OpenForm "your details form",,,strwhere

end if

So, nothing stops you from having menu code that runs the same code that you
could/would put behind a button.

Here is some screen shots and ideas of using menu bars in ms-access:

http://www.attcanada.net/~kallal.msn/Articles/UseAbility/UserFriendly.htm
 
Back
Top