Hi folks.
I have a form, frmHistory, which has 3 toggle buttons (1 of which is
tglName, which I will be using to demonstrate my problem). The buttons
are used to sort the form (explanations below). I have set the
button's "Triple State" value to Yes, and the default value to False.
Here is the macro that I used for tglName (I assigned the macro to the
button's On Click event):
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Condition: Not [Screen].[ActiveControl]
Action: SetValue
Item: [Screen].[ActiveForm].[OrderBy]
Expression: ""
Condition: IsNull([Screen].[ActiveControl])
Action: SetValue
Item: [Screen].[ActiveForm].[OrderBy]
Expression: "frmHistory.MemName"
Condition: [Screen].[ActiveControl]
Action: SetValue
Item: [Screen].[ActiveForm].[OrderBy]
Expression: "frmHistory.MemName DESC"
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-=-=
I also assigned a macro to the form's On Open event:
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Action: SetValue
Item: [Forms]![frmHistory].[OrderBy]
Expression: ""
Action: SetValue
Item: [Forms]![frmHistory].[OrderByOn]
Expression: True
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-=-=
When I open the form, the form isn't sorted, which is how it should
be; when I click tglName, the form is sorted by name in ascending
order; when I click tglName again, the form is sorted in descending
order; and when I click it one final time, the form will be like it
was before, i.e. not sorted at all. So far so good. The problem begins
when I click tglName yet again - the form doesn't sort at all. The
same problem occurs in the other 2 buttons - when I've gone through a
full "loop" with whichever 1 button, the other 2 doesn't work. Any
ideas of what went wrong? Thank you (and my apologies if things are a
bit confusing).