Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Double Click Subform - GoToRecord??

Status
Not open for further replies.
Mar 9, 2007
48
US
Hi again all. I have a form called Clinic. In this form is a subform. The Parent/Child link between the two forms is the Clinic Date field. What I'm attempting to do is dbl-click a field called MRN (number field) on the subform which will go to the corresponding patient record. I found this thread and it works great:
thread702-1316412
However, the problem is that it's possible to have duplicate patient records with duplicate MRN (with different clinic dates). The code in the above thread will find only the first occurance of the MRN field. What I would like to do is have it first find the clinic date on the form then look for the MRN on all records with the same date. Possible? Below is the code in question:

Private Sub MRN_DblClick(Cancel As Integer)
Dim frm As Form
Set frm = Forms(Me.Parent.Name)
frm.Recordset.FindFirst "[MRN] = '" & Me![MRN] & "'"
Set frm = Nothing
End Sub
 
You may try something like this:
Code:
frm.Recordset.FindFirst "MRN='" & Me![MRN] & "' AND [Clinic date]=#" & Me![Clinic date] & "#"

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top