Closing a form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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
 
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
 

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