"click to close" two forms at same time

PattyS

Registered User.
Local time
Today, 12:41
Joined
Jun 20, 2006
Messages
39
Hello, I have been here before so i'll try to make this as understandable as I can

I have a MAIN FORM
I have a DUI FORM
I have a PED FORM
I have TRAFFIC DATA PG2 FORM

On the MAIN FORM I have check boxes to open other forms when needed

Check Box name "PAGE2" when checked opens "TRAFFIC DATA PG2" with codes to link criteria
and auto fill in the "CASENUMBER"

On the TRAFFIC DATA PG2 there are check boxes to open DUI FORM and one to open PED FORM
when needed.

If PED FORM is checked, the PED FORM opens on top of the TRAFFIC DATA PG2 FORM
On the PED FORM there are check boxes to close the PED FORM and return to the MAIN FORM

What I want to do is add something to this close code so that when I close the PED FORM and return to
the MAIN FORM, the TRAFFIC DATA PG2 FORM will close also! Right now it does not close but stays open under the MAIN FORM

check to close PED FORM code:

Private Sub Check24_Click()
If Check24 = True Then
DoCmd.Close
DoCmd.SelectObject acForm, "MAIN FORM"
Forms![MAIN FORM].PAGE2.SetFocus
End If
End Sub

Should I just return to the TRAFFIC DATA PG2 FORM and set focus to this forms close button?
I was trying to circumvent this extra move
 
Insert the following

Code:
docmd.Close acForm,"TRAFFIC DATA PG2 FORM"

To close your TRAFFIC DATA PG2 FORM
 

Users who are viewing this thread

Back
Top Bottom