Afterupdate event and filter name

johiot

New member
Local time
Today, 07:50
Joined
May 10, 2002
Messages
8
Hello,
I have a main form –frmpatients- and a subform-subformuseExams.In the subform I have a textbox –PatientID – and a combobox-Examname.I want when I fill the combo box in the after update event, but only for two values(look the code), to open a form –frmthromvolytika –and find the specified record. The relationship between the 3 forms is the value “PatientID”
I use this code:
Private Sub Examname_AfterUpdate()
If Me.Examname.Value = 111 Then
DoCmd.OpenForm "frmthromvolytika"
End If
If Me.Examname.Value = 110 Then
DoCmd.OpenForm "frmthromvolytika"
End If
End Sub

I tried: DoCmd.OpenForm "frmthromvolytika", "[PatientID] =" & Me![PatientID]
But I receive the message that the database can’ t find the PatientID
Thanks for any answer.
 
DoCmd.OpenForm "frmthromvolytika", , , "[PatientID] = " & Me![PatientID]

Use Help to find the correct syntax for the OpenForm method....
 

Users who are viewing this thread

Back
Top Bottom