HELP i need a macro that will close the current form and open formA (URGENT!!!)

  • Thread starter Matthew Pilkington via AccessMonster.com
  • Start date
M

Matthew Pilkington via AccessMonster.com

i need a macro that will close the current form and open formA
i have 30 forms
Form1
Form2
Form3
.....
Form50

you get the idea!

all forms need a link to FormA but i dont want to write 50 macros i want to
write one that says close current form and open Form A

Any Help please!

Thanks
Mat
 
O

Ofer

I don't understand exactly what you trying to do, but why use a macro and not
a function that get parmeters:

function openMyForm(formtoclose as string, formtoopen as string)
DoCmd.Close acForm, formtoclose
DoCmd.OpenForm formtoopen
end function
 
T

tina

just use the Close action in your macro, as the first action. leave the
ObjectType and ObjectName arguments blank, and the action will close the
active window (whatever form you are calling the macro from).

use OpenForm as the second action in your macro. set the FormName argument
to FormA.

hth
 

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