ODBC—call failed.
[Microsoft][ODBC SQL SERVER Driver][SQL Server]The ORDER BY position number 0 is out of range of the number of items in the select list.(#108)
The text above is the error that I am getting when I try to sort a column in my form.I am not able to understand what this error is supposed to mean.
Here is the code that I am using to sort the column,in case required.
Expand|Select|Wrap|Line Numbers
- Private Function ReOrder(vField As String)
- Screen.MousePointer = MouseBusy
- Me.OrderByOn = True
- If Right(Me.OrderBy, 3) = "ESC" Then 'alleen laatste drie letters resolven
- Me.OrderBy = vField & " ASC"
- Else
- Me.OrderBy = vField & " DESC"
- End If
- Me.Refresh 'requery
- Screen.MousePointer = MouseNormal
- End Function
the I use this code,
Expand|Select|Wrap|Line Numbers
- Private Sub lblPMNO_Click()
- Reorder "No"
- End Sub
Expand|Select|Wrap|Line Numbers
- SELECT DISTINCTROW tblMIMAIN.A_EQUIPDESCR AS
- Equipment, tblMIMAIN.A_EQUIPNO AS [No], tblMIMAIN.A_ID,
- tblMIMAIN.A_LOCATION AS Location, IIf(IsNull(tblMIMAIN!
- A_PROJECTID)," ","**13Mplan**") AS 13Months
- FROM tblMIMAIN
- WHERE (((tblMIMAIN.A_LOCATION)>IIf(GetAsset()
- ="**ALL**","a","ZZ") Or (tblMIMAIN.A_LOCATION)=GetAsset())
- AND ((tblMIMAIN.A_SYSTEM)="STW"));