I'm trying to open a form from a combo box. I have a form with just a unbound combo box. in the after update event I have the code
Private Sub cmbNEWPAT_AfterUpdate()
Dim Criteria As String
If Not IsNull(Me!cmbNEWPAT) Then
Criteria = "RegistrationID = '" & Me!cmbNEWPAT.Column(1) & "'"
DoCmd.OpenForm "frmCODE"
Forms!frmCODE.Filter = Criteria
Forms!frmCODE.FilterOn = True
End If
End Sub
When I try to run this it comes back with an error Runtime error '2001' you canceled the Previous operation…. When it goes in to debug the criteria is correct. I'm stumped can anyone help? Thanks, Tom
Private Sub cmbNEWPAT_AfterUpdate()
Dim Criteria As String
If Not IsNull(Me!cmbNEWPAT) Then
Criteria = "RegistrationID = '" & Me!cmbNEWPAT.Column(1) & "'"
DoCmd.OpenForm "frmCODE"
Forms!frmCODE.Filter = Criteria
Forms!frmCODE.FilterOn = True
End If
End Sub
When I try to run this it comes back with an error Runtime error '2001' you canceled the Previous operation…. When it goes in to debug the criteria is correct. I'm stumped can anyone help? Thanks, Tom