Re-sorting form's records

ellenr

Registered User.
Local time
Today, 11:02
Joined
Apr 15, 2011
Messages
400
I have a popup form listing records in a query. Three buttons in the header are used to specify the sort order. They work well--they sort properly and load a text box in the header with a number for later reference as to the preferred sort order. When datum is entered in one of the fields of the form that affect the sort order, the update event triggers a re-sort. I get an error that I don't understand. "Compile Error: Invalid use of property"

my code:
If SOrd = 2 Then
Me.OrderBy "rd0Sort, rd1Sort, name"
Me.OrderByOn = True
Me.Requery
ElseIf SOrd = 3 Then
Me.OrderBy "rd0Sort, rd2Sort, name"
Me.OrderByOn = True
Me.Requery
End If

The red is actually highlighted in blue when it throws the error. The code that errors is the same code used to sort the records when the buttons in the header are clicked in the first place. Is there a better way to resort the form? Basically what I am trying to do is to get the updated records to move out of the way to the bottom of the list.
 
Oh, my! I just knew it had to be something easy/stupid. Thank you!
 
By the way
Code:
Me.Requery
is not necessary. OrderByOn puts it in your required order, then you do it again with the requery
 

Users who are viewing this thread

Back
Top Bottom