Closing a form

A

Andrew C

i have a main form on the form has a command button that loads another form
based upon information selected in the combo box beside it.

After this form loads using the data i want the main form to closeto
minimise the amount of forms open at one time.

I have tried adding the (docmd.close) at the top but it closes the main form
before opeing the other form and there fore does not display the required
information

Help please
 
O

Ofer

Have you tried something like

Dim MyWhereCondition As String
MyWhereCondition = "[FieldName] = " & Me.comboName
DoCmd.OpenForm "FormName", , , MyWhereCondition
DoCmd.Close acForm, "MainFormName"

Open the form with a criteria, and then close the original form
 
B

Bob Miller

Try connecting the button to a macro or code that opens the new form
based on the criteria from the combo box of the first form and then
close the first form.
 
G

GAB

Hi Andrew,

It sounds like you want to do the same thing that Allen Browne answered in a
previous post titled "Closing Forms" by Derek Brown on 1/20/2006. Allen
provides the necessary code to do what it appears you want to do.

Hope that helps,
Ginger
 
Top