I am trying to use a button "command248" on main form "CLIENTS" to sort by field "Group_Type" on subform "CONTACTS".
In order to accomplish this I added the following code to the "On Click" event of button "command248":
Public Sub OrderForm(strOrder As String, frm As Access.Form)
frm.OrderByOn = False
frm.OrderBy = strOrder
frm.OrderByOn = True
End Sub
Private Sub Command248_Click()
Call OrderForm("Group_Type", Me)
Call OrderForm("Group_Type", Me.CONTACTS.Form)
End Sub
It works properly, but I keep getting this pop-up:
Enter Parameter Value
Group_Type
All of the spelling is accurate--it seems as though the error has to do with entry in "Order By" for Property Sheet.
When I change this from "Group_Type" to something like "strOrder", then the error says "strOrder" parameter value instead of "Group_Type" parameter value.
Not sure if this is the problem or if I need to change something else????
Also, do I need to enter code in any other event box to keep the data sorted (by group type for example) until a different sort button (by last name for example) is clicked?
In order to accomplish this I added the following code to the "On Click" event of button "command248":
Public Sub OrderForm(strOrder As String, frm As Access.Form)
frm.OrderByOn = False
frm.OrderBy = strOrder
frm.OrderByOn = True
End Sub
Private Sub Command248_Click()
Call OrderForm("Group_Type", Me)
Call OrderForm("Group_Type", Me.CONTACTS.Form)
End Sub
It works properly, but I keep getting this pop-up:
Enter Parameter Value
Group_Type
All of the spelling is accurate--it seems as though the error has to do with entry in "Order By" for Property Sheet.
When I change this from "Group_Type" to something like "strOrder", then the error says "strOrder" parameter value instead of "Group_Type" parameter value.
Not sure if this is the problem or if I need to change something else????
Also, do I need to enter code in any other event box to keep the data sorted (by group type for example) until a different sort button (by last name for example) is clicked?