I have a database that helps me keep tabs of a live fantasy football draft. I have a continuous subform on my main form that keeps track of what round I am drafting in and the order of the teams that are drafting. All odd rounds (1, 3, 5, etc...) are sorted in ascending order and all even rounds are sorted in descending order. I am using the following code to achieve this:
Private Sub Form_Current()
Me.OrderByOn = True
If Me.MOD = 1 Then
Me.OrderBy = "DraftOrder"
Else
Me.OrderBy = "DraftOrder DESC"
End If
End Sub
MOD is a control that = 1 if the round number is odd and it is = 0 when the round number is even. The code runs perfectly, except for one minor flaw...I can only select the top record of the continuous form (or in this case, the team that drafts first in that round).
I notice that when Me.OrderByOn = True, that I can only select the top record on my continuous form. However, when Me.OrderByOn = False, I can select any record I want, but the records are not in the desired order. Is there any way around this? Note: When I select any other record, the cursor (focus) is set on the first record instead of the record that I clicked on. Can anyone help me?
TOTCOM11
Private Sub Form_Current()
Me.OrderByOn = True
If Me.MOD = 1 Then
Me.OrderBy = "DraftOrder"
Else
Me.OrderBy = "DraftOrder DESC"
End If
End Sub
MOD is a control that = 1 if the round number is odd and it is = 0 when the round number is even. The code runs perfectly, except for one minor flaw...I can only select the top record of the continuous form (or in this case, the team that drafts first in that round).
I notice that when Me.OrderByOn = True, that I can only select the top record on my continuous form. However, when Me.OrderByOn = False, I can select any record I want, but the records are not in the desired order. Is there any way around this? Note: When I select any other record, the cursor (focus) is set on the first record instead of the record that I clicked on. Can anyone help me?
TOTCOM11