mizenerman
MIS
Hi all,
I've perused this forum and found some answers to my question ( thread702-1440004 and thread702-1434023 ) but I'm unsure how to apply those answers to my issue.
I have this code on an unbound combo box on a form:
Private Sub FindPatient_AfterUpdate()
FilterOn = False
Dim MyRecSet As Object
Set MyRecSet = Me.Recordset.Clone
MyRecSet.FindFirst "[Last_Name]='" & Replace(Me!FindPatient, "'", "''") & "' AND [First_Name]='" & Me!FindPatient.Column(1) & "'"
Me.Bookmark = MyRecSet.Bookmark
End Sub
This combo box is used to look up patients. The error message "invalid use of null" appears when the user leaves the combo box to update another field, click an add button, etc. The code breaks at:
MyRecSet.FindFirst "[Last_Name]='" & Replace(Me!FindPatient, "'", "''") & "' AND [First_Name]='" & Me!FindPatient.Column(1) & "'"
What gives? Your assistance is greatly appreciated.
I've perused this forum and found some answers to my question ( thread702-1440004 and thread702-1434023 ) but I'm unsure how to apply those answers to my issue.
I have this code on an unbound combo box on a form:
Private Sub FindPatient_AfterUpdate()
FilterOn = False
Dim MyRecSet As Object
Set MyRecSet = Me.Recordset.Clone
MyRecSet.FindFirst "[Last_Name]='" & Replace(Me!FindPatient, "'", "''") & "' AND [First_Name]='" & Me!FindPatient.Column(1) & "'"
Me.Bookmark = MyRecSet.Bookmark
End Sub
This combo box is used to look up patients. The error message "invalid use of null" appears when the user leaves the combo box to update another field, click an add button, etc. The code breaks at:
MyRecSet.FindFirst "[Last_Name]='" & Replace(Me!FindPatient, "'", "''") & "' AND [First_Name]='" & Me!FindPatient.Column(1) & "'"
What gives? Your assistance is greatly appreciated.