Closing a form from another form

R

RobUCSD

With the code below everything works except for the DoCmd.Close of the
frmPatientSearch. After loading the selected patient into the
frmPtDemographicNew I want the frmPatientSearch to close. But, being the
rookie coder that I am, I am unable to do this without MVP help.

As always your help is greatly appreciated. Rob


Private Sub lstMRNsearchGoToPt_DblClick(Cancel As Integer)

Dim stDocName1 As String
Dim stDocName2 As String
Dim stLinkCriteria As String

stDocName1 = "frmPtDemographicNew"
stDocName2 = "frmPatientSearch"

stLinkCriteria = "[MRN]=" & Me.lstMRNsearchGoToPt.Column(0)
DoCmd.OpenForm stDocName1, , , stLinkCriteria
DoCmd.Close
stDocName2 = "frmPatientSearch"

End Sub
 

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