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

  • Thread starter Thread starter Matthew Pilkington via AccessMonster.com
  • Start date 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
 
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
 
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
 
Back
Top