Results 1 to 2 of 2
  1. #1
    bakkouz is offline Novice
    Windows XP Access 2007
    Join Date
    Jan 2011
    Posts
    25

    Continuous form filtered by combo boxes to show also Null fields

    Heya,

    I have a Continuous form that is filtered by a number of combo boxes, it all works fine and well, But my problem is that when the value in the combo box is Null, the Continuous form resets (shows all records).
    Want I want it to do though is show the corresponding fields in the form that are empty.

    I'm using the current code:

    Private Sub Form_Open(Cancel As Integer)
    lngFirstTime = 0
    End Sub

    Private Sub Combo703_AfterUpdate()
    DoFilter
    End Sub

    Private Sub DoFilter()
    Dim fStr As String


    fStr = "true "
    If Trim(Nz(Combo703, "")) <> "" Then fStr = fStr + "and [Vendor]='" & Combo703 & "' "
    Me.Filter = fStr
    Me.FilterOn = True
    End Sub

    help would be much appreciated.
    Thanks.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,915
    Try:
    Me.Filter = If IsNull(Combo703) Then Is Null Else "True And [Vendor]='" & Combo703 & "' "
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 9
    Last Post: 06-04-2014, 10:45 AM
  2. cascading combo boxes in continuous subform
    By ayamali in forum Programming
    Replies: 1
    Last Post: 03-29-2011, 06:33 PM
  3. Dont show null fields in report
    By senna in forum Reports
    Replies: 4
    Last Post: 03-03-2011, 02:30 PM
  4. Replies: 5
    Last Post: 01-02-2011, 10:09 AM
  5. cascading combo boxes on Continuous Forms
    By Jerry8989 in forum Forms
    Replies: 0
    Last Post: 10-12-2009, 10:02 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums