Open form via VBA on tool menu!

  • Thread starter Thread starter Niklas Östergren
  • Start date Start date
N

Niklas Östergren

Hi!

I know that it´s possible to open a form with a cmd on a tool menu. And I
know that I can do it with a cmd which runs a macro. BUT is it possible to
run a subprocedure (VBA) instead?

TIA!

// Niklas
 
Hi Niklas have a look at my question from the 25th headed Custom Menus
Albert Kallal gave me the answer and I think it solves your problem too
Tony Williams
 
Thanks Tony!

I have read throug this but I can´t get it to work woth opening a form
(frmPerson).

I have created a form (frmTestOpenForm) on which I have 2 cmd:s
(cmdAllPerson & cmdMembers).

I use DoCmd.OpenForm to open up the form. This works ok! I.E to your message
25 marsh I have made the functions public.

I have also created a cmd. in my custom menu bar but I can´t find any place
where I can link the cmd on my custom manu bar to the public function!

Any idéas!

TIA!
// Niklas
 
I think it should go in the properties of the custom menus setting OnAction
if your public function is called OpenForm it should be =OpenForm()
Tony
 
Hi Tony!

I opened up an old book (Secrets in Access 97) and found how to do, it´s
easy.

First I hade to create a public function, like you allready said.
Then I just had to call that function from the command button on my tool bar
by writing the function name in the box <On Event> like this:

= Functionsname ()

That´s it!
Don´t forget = and ().

Reguards!
// Niklas
 
Back
Top