comboBox open a form and close a form

hyousef

Registered User.
Local time
Today, 15:54
Joined
Jan 15, 2002
Messages
41
My main form has a combobox.
Users can choose from a combobox to open a form.
I got this to work but i need to close the main form when another form is open.
How can i close the main form after a user choose an item from the combo box?

I know how to do it with a command button by Macro but how to do it using a combo box?

Thanks in advance.
 
Either leave the form open as there is generally no reason to close it or close it from the On Open event of the opening form.
 
May be i didn't explain well in the previous message.

ok, I have form1, form2, and form3.
Form1 is the main form which has the combo Box that users need to select from to go or to open other forms.
when a user choose to open form2 from the combo box, it should open from2 and close form1(MainForm).

How can i close form1?

Thanks
 
on the open event of the new form try

docmd.close acform, form1

check the help file for syntax

ian
 
Why close it? You will just have to open it when you close form 2. If you must close it then follow Ian's advice.
 
i added the close sentence in the new form and its working.

Thanks guys.
 

Users who are viewing this thread

Back
Top Bottom