Sort values, text, based on field I'm in.

amerifax

Registered User.
Local time
Today, 09:11
Joined
Apr 9, 2007
Messages
304
In a form is there a way to change sort order based on which field is active?

I'm using a Split Form which gives me the ability to sort by clicking on the header name ans selecting sort. This slowing things done since my workload is heavy.
Bob
 
Sounds like you are using a table as the form's ControlSource. Make queries that sort the data as you need it, then put a spot of code in to make either/or of these queries to be your ControlSource based on whatever event drives this all.
 
Thanks. I will give it a go.
BOB
 
I got the following error: This error occurs when an event has failed to run because the location of the logic for the event cannot be evaluated. For example, if the OnOpen property of a form is set to =[Field], this error occurs because a macro or event name is expected to run when the event occurs.

My query is: SELECT [MST-SC-Muni].Municipality, [MST-SC-Muni].SC, [MST-SC-Muni].TypeCity, [MST-SC-Muni].County, [MST-SC-Muni].WRK
FROM [MST-SC-Muni]
ORDER BY [MST-SC-Muni].Municipality;

My field on form is "Municipality" and it is a non edit Field.

For "Municipality" I used "Event"\=[Municipality Query]![Municipality]

Since this is my first attempt at using an "Event" it's not a surprise to me. I figured "On Got Focus " was the way to go.

Bob
 

Users who are viewing this thread

Back
Top Bottom