Hello,
back for some advice and would appreciate your help.
I have a form with a list box (List0), a text box (txtLName) used as query criteria and a cmd button which runs the query as record source of the list box.
On the Click Event of a cmd button I have this code:
I was now hoping to add another cmd button to sort records in the listbox (ascending and descending at the same time). I have found a lot of examples, but just cannot get it working. Do you think this is a good practice? I do want to different button. Thank you for your help.
back for some advice and would appreciate your help.
I have a form with a list box (List0), a text box (txtLName) used as query criteria and a cmd button which runs the query as record source of the list box.
On the Click Event of a cmd button I have this code:
Code:
If Len(List0) & "" > 0 And DCount("*", "qryLNAME") > 0 Then
Me.List0.RowSource = "qryLNAME"
Me.List0.Requery
Else
MsgBox "Sorry, no records were found.", vbInformation, "Search Menu"
Me.txtLname.value = Null
Me.txtLname.SetFocus
Exit Sub
End If
Exit Sub
End If
I was now hoping to add another cmd button to sort records in the listbox (ascending and descending at the same time). I have found a lot of examples, but just cannot get it working. Do you think this is a good practice? I do want to different button. Thank you for your help.