Hi all, I write the code to filter subform by two criteria on after update of textbox, but i think that's long and should be a way to brief that, Can someone help me or give a correct way to do this??
Code:
Private Sub Text5_AfterUpdate()
If IsNull(Me.Text5) And IsNull(Me.Text25) Then
Me.child85.Form.RecordSource = "SELECT * FROM qry_Customers2 "
ElseIf Not IsNull(Me.Text25) And Not IsNull(Me.Text5) Then
Me.child85.Form.Filter = "[S_Active] = '" & Me.Text5 & "' And [fgk]=" & Me.Text25
Me.child85.Form.FilterOn = True
ElseIf IsNull(Me.Text25) And Not IsNull(Me.Text5) Then
Me.child85.Form.Filter = "[S_Active] = '" & Me.Text5 & "'"
Me.child85.Form.FilterOn = True
ElseIf Not IsNull(Me.Text25) And IsNull(Me.Text5) Then
Me.child85.Form.Filter = "[fgk]=" & Me.Text25
Me.child85.Form.FilterOn = True
End If