i am writing a function to sort data on a subform:
CODE
Public Function SortAZ()
'bepalen welke kolom focus heeft
Dim ctlCurrentControl As Control, strControlName As String
Set ctlCurrentControl = Screen.ActiveControl
strControlName = ctlCurrentControl.Name
'MsgBox strControlName
'alfabetisch sorteren volgens control die focus heeft
Me.Parent!frmSpotten.Form.OrderBy = strControlName
Me.Parent!frmSpotten.Form.OrderByOn = True
End Function
i call =SortAZ() on the doubleclick event of the control. But i'm having troubles with the last 2 lines in the function.
Also, i would like to know how i can pass the variable formname (so the name of the subformcontrol on the mainform) through with the function to be able to use the same function on different subforms. (something like =SortAZ(formname) ?)
thanks!