null values

kim40

Registered User.
Local time
Today, 01:23
Joined
Aug 24, 2012
Messages
30
I am created a form I need my users to enter amounts and date paid. I need the form to show only the companies that are in arrears. I have this code but my form comes up empty. Can any one help
Code:
Private Sub CboFilter_Change()

'If the combo box is cleared, clear the form filter.
  If Nz(Me.CboFilter.Value) = "" Then
    Me.Form.Filter = ""
    Me.FilterOn = False
    
  ' If a combo box item is selected, filter for an exact match.
  ' Use the ListIndex property to check if the value is an item in the list.
  ElseIf Me.CboFilter.ListIndex <> -1 Then
    Me.Form.Filter = "[Importer Name] = '" & Nz(Me.Amount_Paid.Value) = "" & _
                     Replace(Me.CboFilter.Value, "'", "''") & "'"
    Me.FilterOn = True
    
  ' If a partial value is typed, filter for a partial company name match.
  Else
    
    Me.Form.Filter = "[Importer Name] Like '*" & _
                     Replace(Me.CboFilter.Value, "'", "''") & "*'"
    Me.FilterOn = False

  End If
  
  ' Move the cursor to the end of the combo box.
  Me.CboFilter.SetFocus
  Me.CboFilter.SelStart = Len(Me.CboFilter.Value)

End Sub
 

Users who are viewing this thread

Back
Top Bottom