G
Gina Whipp
Hello All,
The below code works, so why am I here??? Well, the Select Case
cboFieldName cause a repainting which I would prefer to avoid. I would like
it sort by whichever field you choose without the repaint, if that is at all
possible.
Thanks in advance,
Gina Whipp
Private Sub ApplyFormFilter(strFieldName As String)
Dim strFilter As String
Dim strDefaultFilter As String
Dim strDelimiter As String
strDelimiter = Chr$(34)
strDefaultFilter = "*"
strFieldName = "[" + strFieldName + "] Like "
Select Case Me!optFilter
Case 1: strFilter = Nz("[AÀÁÂÃÄ]*", strDefaultFilter)
Case 2: strFilter = Nz("B*", strDefaultFilter)
Case 3: strFilter = Nz("[CÇ]*", strDefaultFilter)
Case 4: strFilter = Nz("D*", strDefaultFilter)
Case 5: strFilter = Nz("[EÈÉÊË]*", strDefaultFilter)
Case 6: strFilter = Nz("F*", strDefaultFilter)
Case 7: strFilter = Nz("G*", strDefaultFilter)
Case 8: strFilter = Nz("H*", strDefaultFilter)
Case 9: strFilter = Nz("[IÌÍÎÏ]*", strDefaultFilter)
Case 10: strFilter = Nz("J*", strDefaultFilter)
Case 11: strFilter = Nz("K*", strDefaultFilter)
Case 12: strFilter = Nz("L*", strDefaultFilter)
Case 13: strFilter = Nz("M*", strDefaultFilter)
Case 14: strFilter = Nz("[NÑ]*", strDefaultFilter)
Case 15: strFilter = Nz("[OÒÓÔÕÖ]*", strDefaultFilter)
Case 16: strFilter = Nz("P*", strDefaultFilter)
Case 17: strFilter = Nz("Q*", strDefaultFilter)
Case 18: strFilter = Nz("R*", strDefaultFilter)
Case 19: strFilter = Nz("[SS]*", strDefaultFilter)
Case 20: strFilter = Nz("T*", strDefaultFilter)
Case 21: strFilter = Nz("[UÙÚÛÜ]*", strDefaultFilter)
Case 22: strFilter = Nz("V*", strDefaultFilter)
Case 23: strFilter = Nz("W*", strDefaultFilter)
Case 24: strFilter = Nz("X*", strDefaultFilter)
Case 25: strFilter = Nz("[YÝÿ]*", strDefaultFilter)
Case 26: strFilter = Nz("[ZÆØÅ]*", strDefaultFilter)
Case 27: strFilter = "*"
End Select
strFilter = strFieldName + Chr$(34) + Nz(strFilter, "*") + Chr$(34)
Me.Filter = strFilter
Me.FilterOn = True
'THIS IS THE PART THAT CAUSES THE REPAINT
Select Case cboFieldName
Case "cpFirstName"
Me.OrderBy = "cpFirstName"
Me.OrderByOn = True
Case "cpLastName"
Me.OrderBy = "cpLastName"
Me.OrderByOn = True
Case "DisplayName"
Me.OrderBy = "DisplayName"
Me.OrderByOn = True
End Select
End Sub
The below code works, so why am I here??? Well, the Select Case
cboFieldName cause a repainting which I would prefer to avoid. I would like
it sort by whichever field you choose without the repaint, if that is at all
possible.
Thanks in advance,
Gina Whipp
Private Sub ApplyFormFilter(strFieldName As String)
Dim strFilter As String
Dim strDefaultFilter As String
Dim strDelimiter As String
strDelimiter = Chr$(34)
strDefaultFilter = "*"
strFieldName = "[" + strFieldName + "] Like "
Select Case Me!optFilter
Case 1: strFilter = Nz("[AÀÁÂÃÄ]*", strDefaultFilter)
Case 2: strFilter = Nz("B*", strDefaultFilter)
Case 3: strFilter = Nz("[CÇ]*", strDefaultFilter)
Case 4: strFilter = Nz("D*", strDefaultFilter)
Case 5: strFilter = Nz("[EÈÉÊË]*", strDefaultFilter)
Case 6: strFilter = Nz("F*", strDefaultFilter)
Case 7: strFilter = Nz("G*", strDefaultFilter)
Case 8: strFilter = Nz("H*", strDefaultFilter)
Case 9: strFilter = Nz("[IÌÍÎÏ]*", strDefaultFilter)
Case 10: strFilter = Nz("J*", strDefaultFilter)
Case 11: strFilter = Nz("K*", strDefaultFilter)
Case 12: strFilter = Nz("L*", strDefaultFilter)
Case 13: strFilter = Nz("M*", strDefaultFilter)
Case 14: strFilter = Nz("[NÑ]*", strDefaultFilter)
Case 15: strFilter = Nz("[OÒÓÔÕÖ]*", strDefaultFilter)
Case 16: strFilter = Nz("P*", strDefaultFilter)
Case 17: strFilter = Nz("Q*", strDefaultFilter)
Case 18: strFilter = Nz("R*", strDefaultFilter)
Case 19: strFilter = Nz("[SS]*", strDefaultFilter)
Case 20: strFilter = Nz("T*", strDefaultFilter)
Case 21: strFilter = Nz("[UÙÚÛÜ]*", strDefaultFilter)
Case 22: strFilter = Nz("V*", strDefaultFilter)
Case 23: strFilter = Nz("W*", strDefaultFilter)
Case 24: strFilter = Nz("X*", strDefaultFilter)
Case 25: strFilter = Nz("[YÝÿ]*", strDefaultFilter)
Case 26: strFilter = Nz("[ZÆØÅ]*", strDefaultFilter)
Case 27: strFilter = "*"
End Select
strFilter = strFieldName + Chr$(34) + Nz(strFilter, "*") + Chr$(34)
Me.Filter = strFilter
Me.FilterOn = True
'THIS IS THE PART THAT CAUSES THE REPAINT
Select Case cboFieldName
Case "cpFirstName"
Me.OrderBy = "cpFirstName"
Me.OrderByOn = True
Case "cpLastName"
Me.OrderBy = "cpLastName"
Me.OrderByOn = True
Case "DisplayName"
Me.OrderBy = "DisplayName"
Me.OrderByOn = True
End Select
End Sub