Yes, on your commandbutton click event, chk to see if the pop up form is open
if (currentproject.allforms("formName").Isloaded) then
docmd.close acform, "formName", acSaveYes
Dim intX As Integer
Dim intCount As Integer
intCount = Forms.Count - 1
For intX = intCount To 0 Step -1
If Forms(intX).name = "myform" Then
DoCmd.Close acform,Forms(intX).name
Exit Sub
End if
Next
DoCmd.OpenForm "myform"
Yes, on your commandbutton click event, chk to see if the pop up form
is open if (currentproject.allforms("formName").Isloaded) then
docmd.close acform, "formName", acSaveYes