DoCmd.Close not closing form

  • Thread starter Thread starter HeislerKurt
  • Start date Start date
H

HeislerKurt

I'm trying to automatically close a popup form (frmSearch), when the
user clicks on a control in a continuous subform (frmSearchResults).
My DoCmd.close statement appears to be doing nothing as the popup form
stays open. Any ideas? Thank you.

###

Private Sub Pt_LName_Click()

Dim rs As Object
Set rs = Forms!frmPatients.Recordset.Clone

Forms!frmPatients.SetFocus

rs.FindFirst "[PatientID] = " & Me.PatientID
If Not rs.EOF Then Forms!frmPatients.Bookmark = rs.Bookmark

' Problem persists even if I delete this line or
' swap the order of this line with the DoCmd line
Forms!frmPatients!txtFocusControl.SetFocus

DoCmd.Close acForm, "frmSearchAdanced"

End Sub

###
 
Your description of the problem says that the popup form is named
"frmSearch", but the "DoCmd.Close" code is referencing a form named
"frmSearchAdvanced"?
 
actually, the code posted refers to "frmSearchAdanced" not
"frmSearchAdvanced", increasing the odds that it's the source of the problem
:-)


--
HTH,
George


Ken Snell (MVP) said:
Your description of the problem says that the popup form is named
"frmSearch", but the "DoCmd.Close" code is referencing a form named
"frmSearchAdvanced"?

--

Ken Snell
<MS ACCESS MVP>


I'm trying to automatically close a popup form (frmSearch), when the
user clicks on a control in a continuous subform (frmSearchResults).
My DoCmd.close statement appears to be doing nothing as the popup form
stays open. Any ideas? Thank you.

###

Private Sub Pt_LName_Click()

Dim rs As Object
Set rs = Forms!frmPatients.Recordset.Clone

Forms!frmPatients.SetFocus

rs.FindFirst "[PatientID] = " & Me.PatientID
If Not rs.EOF Then Forms!frmPatients.Bookmark = rs.Bookmark

' Problem persists even if I delete this line or
' swap the order of this line with the DoCmd line
Forms!frmPatients!txtFocusControl.SetFocus

DoCmd.Close acForm, "frmSearchAdanced"

End Sub

###
 
George Nicholson said:
actually, the code posted refers to "frmSearchAdanced" not
"frmSearchAdvanced", increasing the odds that it's the source of the
problem :-)

< chuckle > My proofreading skills seem to be lessening with age...
 
And my proofreading skills seem to be lessening as the day goes on.
That typo was indeed the problem. Much thanks.

Kurt
 
Back
Top