Button with two events

  • Thread starter Thread starter Dreamer
  • Start date Start date
D

Dreamer

Hello Everybody

I need to create a button that:

1- Close the form to which belongs
2- Open another form neither or closed the previous one.

Thanks!
 
Hi Dreamer -
I use Macros a lot to do this. Create a macro with 2 lines
OpenForm - name of form to open
CloseForm - name of form to close
Then create your button, choose the Misc category and Run Macro action.
Choose the macro you created.
Hope this gives you what you need.
Yours - Dika
 
Thanks for answer!

I need do this without Macros... Its possible?

Thanks!
 
Hi again - code would be something like this

DoCmd.OpenForm "form to be opened", acNormal, "", "", , acNormal
DoCmd.Close acForm, "form to be closed"
 
Thank you very much Kernow Girl!!

I use only code, because I distribute the application to several users who have different OS and different versions from office, and have experienced some problems with macros.

Thanks!

Dreamer.-

--------------------------------------------------------------------------------
 
Hi Dreamer - glad that helped. By the way, I may be teaching you to suck
eggs, but when I do use code I create the Macro first (my background is not
in coding) to get the commands and logic flow and then Save as Module. It
then shows we what the code is and I can slot it in where needed.

yours -- Dika
 

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

Back
Top