Opening one form based on 2 criteria in another form

K

kejo41

I have a general form that contains patient information. In this form I can
scroll through different exam dates for a particular patient. I need to be
able to open a second form (for editing) based on two criteria, patient ID
and exam visit date.

I have used open args before to open a form when only one criteria was being
passed, howeverm, I can't figure this one out. Any help would be appreciated.

Thanks.
 
P

PieterLinden via AccessMonster.com

kejo41 said:
I have a general form that contains patient information. In this form I can
scroll through different exam dates for a particular patient. I need to be
able to open a second form (for editing) based on two criteria, patient ID
and exam visit date.

I have used open args before to open a form when only one criteria was being
passed, howeverm, I can't figure this one out. Any help would be appreciated.

Thanks.

You're opening this from a button, right? Then in the button's click event,
you have something like

Sub cmdOpenSomeOtherForm_Click()
Dim strFilter as string
strFilter = "[PatientID]=" & Me.cboPatientID & " AND [ExamDate]=#" & me.
txtExamDate & "#"
docmd.OpenForm "MyForm",acNormal,,strFilter,acFormEdit,acWindowNormal
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