N
newdatabaser via AccessMonster.com
I am trying to implement the custom sort feature defined by Microsoft Article
Q146310. I'm am using the northwind database. I receive a 438 error "Object
doesn't support this property or method" error. The debugger takes me to the
line below denoted by the "***". I've just begun my programming course so
I'm new to coding. I have tried implementing this on a different database
with the same results. Any ideas?
Also what is the " DESC" defined in this code?
Private Sub SetOrderBy_Click()
Dim strSQL As String, intCounter As Integer
' Build strSQL String.
For intCounter = 1 To 2
If Me("Sort" & intCounter) <> "" Then
strSQL = strSQL & "[" & Me("Sort" & intCounter) & "]"
*** If Me("Check" & intCounter) = True Then
strSQL = strSQL & " DESC"
End If
strSQL = strSQL & ", "
End If
Next
If strSQL <> "" Then
' Strip Last Comma & Space.
strSQL = Left(strSQL, (Len(strSQL) - 2))
' Set the OrderBy property.
Reports![Sort Report].OrderBy = strSQL
Reports![Sort Report].OrderByOn = True
End If
End Sub
Q146310. I'm am using the northwind database. I receive a 438 error "Object
doesn't support this property or method" error. The debugger takes me to the
line below denoted by the "***". I've just begun my programming course so
I'm new to coding. I have tried implementing this on a different database
with the same results. Any ideas?
Also what is the " DESC" defined in this code?
Private Sub SetOrderBy_Click()
Dim strSQL As String, intCounter As Integer
' Build strSQL String.
For intCounter = 1 To 2
If Me("Sort" & intCounter) <> "" Then
strSQL = strSQL & "[" & Me("Sort" & intCounter) & "]"
*** If Me("Check" & intCounter) = True Then
strSQL = strSQL & " DESC"
End If
strSQL = strSQL & ", "
End If
Next
If strSQL <> "" Then
' Strip Last Comma & Space.
strSQL = Left(strSQL, (Len(strSQL) - 2))
' Set the OrderBy property.
Reports![Sort Report].OrderBy = strSQL
Reports![Sort Report].OrderByOn = True
End If
End Sub