DoCmd.Close not closing form

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

###
 
K

Ken Snell \(MVP\)

Your description of the problem says that the popup form is named
"frmSearch", but the "DoCmd.Close" code is referencing a form named
"frmSearchAdvanced"?
 
G

George Nicholson

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

###
 
K

Ken Snell \(MVP\)

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

HeislerKurt

And my proofreading skills seem to be lessening as the day goes on.
That typo was indeed the problem. Much thanks.

Kurt
 

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

Top