I have a form based on a table containing organization's member data. In order to allow the user to sort on any column, I add a hidden field for each column, then set an onclick event as follows (using the first name field as an example):
The db was written as a standalone db, but have decided to migrate tables to MySql. As originally written, the "sort on column" routines worked perfectly. After changing to the MySql tables, the me.orderby operations do not work. I have made the LabelFirstMarker visible so I could determine if it was actually going through the vba code, and it does alternate between 1 and 2 when First_Label is clicked. The order of the table does not change, however. I know the me.requery executes because the form blinks.
Also, in the onopen event of the form, I execute a Me.OrderBy = "Last, First" which doesn't work either. It seems like it just has to have something to do with MySql, but I cannot figure it out.
Code:
Private Sub First_Label_Click()
If LabelFirstMarker <> 2 Then
Me.OrderBy = "First, Last"
LabelFirstMarker = 2
Else
Me.OrderBy = "First DESC, Last DESC"
LabelFirstMarker = 1
End If
Me.Requery
End Sub
Also, in the onopen event of the form, I execute a Me.OrderBy = "Last, First" which doesn't work either. It seems like it just has to have something to do with MySql, but I cannot figure it out.