I am tring to put a order by button that allows the user to order the records in a continous form by clicking on the button while they are on the field that they want to order the records by
My form has records source as a query(name query2) as follows
SELECT EMPCODE, FORMNUMBER, PROJECT
FROM ACTIVITY
WHERE (((ACTIVITY.EMPCODE)=[CurrentUser])
ORDER BY [Forms]![activitysub2]![ordby];
In the order by button I have the code
ordby = "FORMNUMBER"
Form.Refresh
Form.Requery
I don't know how to get the current field yet so I have hard coded ordby field to see if it will work. The order of the records does not change. Does anybody know what is wrong
My form has records source as a query(name query2) as follows
SELECT EMPCODE, FORMNUMBER, PROJECT
FROM ACTIVITY
WHERE (((ACTIVITY.EMPCODE)=[CurrentUser])
ORDER BY [Forms]![activitysub2]![ordby];
In the order by button I have the code
ordby = "FORMNUMBER"
Form.Refresh
Form.Requery
I don't know how to get the current field yet so I have hard coded ordby field to see if it will work. The order of the records does not change. Does anybody know what is wrong