Hi folks.
My form, frmHistory, has a combo box, cboName, that filters frmHistory
by member's name (using a macro). frmHistory also has a few labels
that I use for sorting the form (using VBA code). The problem is that,
when I filter the form using cboName, I can't sort the filtered form
(the form becomes empty if I try to sort). Here are the coding (I'm
using the sorting code for 1 of the labels). Does anyone know what
went wrong? I'm using Access 97. Thanks
--------------------------------------------------------------------------------
Private Sub Form_Open(Cancel As Integer)
Me.OrderBy = ""
Me.OrderByOn = True
DoCmd.ShowAllRecords
End Sub
---------------------------------------------------------------------------------------
Private Sub lbl_AccNo_Click()
Static x
x = x + 1
If x > 2 Then x = 1
Select Case x:
Case 1: Me.OrderBy = "AccNo"
Me.OrderByOn = True
Case 2: Me.OrderBy = "AccNo DESC"
Me.OrderByOn = True
End Select
End Sub
---------------------------------------------------------------------------------------
macro_cboName
Action: OpenForm
Form name: frmHistory
Where Condition: [MemName]=[Forms]![frmHistory].[cboName]
Action: SetValue
Item: [Forms]![frmHistory]![cboName]
Expression: Null