I actually researched this in this forum and found lots of them
but their cases are kinda complicated. So, I decided to post this.
Here's my case:
You may check an image of it here:
The cboDateToSort is a combobox in a SubForm.
It has a ControlSource based from the RecordSource of the SubForm.
The DB data are connected via ODBC-DAO.
The data are retrieved from DB and properly displayed in a Datasheet view.
But when I'm about to sort the displayed data, this error 2448 occurred.
The OrderBy and OrderByOn properties of the Datasheet SubForm supposed to be related only to the data displayed/viewed, right?
Can anyone tell me the reason why I am having this error?
but their cases are kinda complicated. So, I decided to post this.
Here's my case:
Code:
Private Sub cmdSortStartDate_Click()
Dim frm As Access.Form
Dim sSortOrder As String
If cboSortBy.Value = "Descending" Then _
sSortOrder = "DESC"
Set frm = subfrm_L5OrigPlan.Form
With frm
.OrderBy = cboDateToSort.Value & " " & sSortOrder '<<< ERROR
.OrderByOn = True
End With
End Sub
You may check an image of it here:
The cboDateToSort is a combobox in a SubForm.
It has a ControlSource based from the RecordSource of the SubForm.
The DB data are connected via ODBC-DAO.
The data are retrieved from DB and properly displayed in a Datasheet view.
But when I'm about to sort the displayed data, this error 2448 occurred.
The OrderBy and OrderByOn properties of the Datasheet SubForm supposed to be related only to the data displayed/viewed, right?
Can anyone tell me the reason why I am having this error?