List box didnt filter after delete the text box value

avan
3StarLounger
Posts: 223
Joined: 08 Oct 2017, 09:50

List box didnt filter after delete the text box value

Post by avan »

After i delete the value in text box, the list box is showing full list (picture 3). How can the list box show back the filter list (picture 1).
You do not have the required permissions to view the files attached to this post.

avan
3StarLounger
Posts: 223
Joined: 08 Oct 2017, 09:50

Re: List box didnt filter after delete the text box value

Post by avan »

This is the database.
You do not have the required permissions to view the files attached to this post.

User avatar
HansV
Administrator
Posts: 78232
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: List box didnt filter after delete the text box value

Post by HansV »

Here is a new version

Code: Select all

Private Sub txtState_Change()
    Dim strWhere As String
    Select Case grpOrders
        Case 1   ' Zone America
            strWhere = strWhere & " AND Zone='AMERICA'"
        Case 2   ' Zone Europe
            strWhere = strWhere & " AND Zone='EUROPE'"
        Case 3   ' others Zone
            strWhere = strWhere & " AND Zone='OTHERS'"
            Select Case grpOrders1
                Case 1   ' with orders pending
                    strWhere = strWhere & " AND Country='ASIA'"
                Case 2   ' without pending orders
                    strWhere = strWhere & " AND Country='AFRICA'"
            End Select
    End Select
    If Not IsNull(Me.cmbYEAR) And Me.cmbYEAR <> "<All>" Then
        strWhere = strWhere & " AND YEAR = '" & Me.cmbYEAR & "'"
    End If
    If Me.txtState.Text = "" Then
        strWhere = " WHERE " & Mid(strWhere, 6)
        Me.cmbState.RowSource = "SELECT Dummy FROM tblAll UNION SELECT STATEID FROM Master" & strWhere
    Else
        strWhere = strWhere & " AND StateID Like '" & Me.txtState.Text & "*'"
        strWhere = " WHERE " & Mid(strWhere, 6)
        Me.cmbState.RowSource = "SELECT Dummy FROM tblAll WHERE Dummy <> ""<All>"" UNION SELECT STATEID FROM Master" & strWhere
    End If
End Sub
Best wishes,
Hans

avan
3StarLounger
Posts: 223
Joined: 08 Oct 2017, 09:50

Re: List box didnt filter after delete the text box value

Post by avan »

Thanks Hansv. :clapping:

avan
3StarLounger
Posts: 223
Joined: 08 Oct 2017, 09:50

Re: List box didnt filter after delete the text box value

Post by avan »

How come the No Dun not able to filter by year, state and parti?
You do not have the required permissions to view the files attached to this post.

User avatar
HansV
Administrator
Posts: 78232
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: List box didnt filter after delete the text box value

Post by HansV »

I get error messages when I try to open Menu_Search. You have removed too much from the database.

S3546.png
You do not have the required permissions to view the files attached to this post.
Best wishes,
Hans

avan
3StarLounger
Posts: 223
Joined: 08 Oct 2017, 09:50

Re: List box didnt filter after delete the text box value

Post by avan »

Hi Hans, I'm manage to solved the previous query after few try. Now I have another query need your help.

After I select the No DUN, how can I make the DUN item in highlight.
To enter this page, you select the Menu_CALON and click inquiry.
You do not have the required permissions to view the files attached to this post.

User avatar
HansV
Administrator
Posts: 78232
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: List box didnt filter after delete the text box value

Post by HansV »

This doesn't work either - I get the same error messages.
Best wishes,
Hans

avan
3StarLounger
Posts: 223
Joined: 08 Oct 2017, 09:50

Re: List box didnt filter after delete the text box value

Post by avan »

Hi Hans, I'm manage to solved the previous query after few try.

User avatar
HansV
Administrator
Posts: 78232
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: List box didnt filter after delete the text box value

Post by HansV »

Good to hear that!
Best wishes,
Hans