My Assistant
![]() ![]() |
|
|
Oct 4 2005, 09:59 AM
Post
#1
|
|
|
UtterAccess Guru Posts: 656 |
hi,
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! |
|
|
|
Oct 4 2005, 12:06 PM
Post
#2
|
|
|
UtterAccess Guru Posts: 656 |
i can get the formname via:
=SortAZ([formname]) and then: Public Function SortAZ(formname as String) but how should i call it then? I tried: Forms!frmMain!formname.Form.OrderBy = strControlName & " DESC" but that doesnt work. I guess its a matter of definition? |
|
|
|
![]() ![]() |
|
Go to Top · Lo-Fi Version | Time is now: 19th June 2013 - 10:12 AM |