One form opens another one closes

manners

Registered User.
Local time
Today, 20:03
Joined
Oct 10, 2001
Messages
16
I'm want to be able to attach code to a button so that when the button is clicked, the new form opens and the old form (with the button on)closes.

Can anyone give me any help please?
 
The following code Opens the Fiscal Search Menu form and closes the Main Menu form. Put it on the OnClick event of a button.
DoCmd.OpenForm "Fiscal Search Menu"
DoCmd.Close acForm, "Main Menu"

Good Luck
 
Shorter...? Yes...
More Professional...?
What the heck does that mean...?

You have no error handling on the shorter version...And you are limited to a set form that you are opening...

Not sure why you would be semi-insulting to a reply that didn't fit your requirements...especially when you never said you needed something short and sweet...Kinda rude...

Well, your welcome anyway...
Don't expect me to throw an answer at you in the future...
 
I think you took my message the wrong way as I was actually being sincere.

I didn't refresh the screen, thus didn't see his reply when I sent the thank you message.

I wasn't referring to rshultzs reply being more professional as I didn't try it that way as you replied first!


I
 
Mis-understandings...ahhhh...

Gotta love em...

Sorry man, I was having a horrible day when I saw that little number...and when I responded...

I apologize...thanks for clearing that up...

(meek look)
Forgive me...sheesh! (Im an eeediot!)

(glad I could help?)
 
Glad to see you sorted your differences out......I now have a question.

What is the difference between the two codes, apart from one being longer - wouldn't you have to enter the name of the form into each code?

Ian
 
No, you could actually enter a variable and create a text field/combo-box to select the form you wanted to open from there...

(altho, in retrospect, you could do the same in the other...the quotes threw me off...)
 

Users who are viewing this thread

Back
Top Bottom