I have a continuous form with a column PriorityNum. The purpose of this column is to be able to display in what order I want the records to appear. I have two command buttons that move a record up one or down one depending on which is clicked. All this works fine. This is the code for the down button
What does not work is which row is highlighted after the requery. The highlighted row is the first row. I tried to add the following two lines of code at the end of the above code but am getting a "Method or Data Member not found"
If I was on record 8 and I click the down button then record 8 becomes record 9 and 9 become 8. I then want the cursor to be on record 9.
Am I missing something? Thanks
You don't know what you don't know...
Code:
' Moves PriorityNum down by one
Private Sub cmdDownArrow_Click()
If Me!PriorityNum >= DMax("PriorityNum", "tblStudy") Then
MsgBox "This record cannot move down"
Exit Sub
End If
Dim NewPos As Integer
NewPos = Me!PriorityNum + 1
Me!PriorityNum = NewPos
DoCmd.GoToRecord , , acNext
Me!PriorityNum = Me!PriorityNum - 1
Me.Requery
What does not work is which row is highlighted after the requery. The highlighted row is the first row. I tried to add the following two lines of code at the end of the above code but am getting a "Method or Data Member not found"
Code:
Me.PriorityNum.SetFocus
DoCmd.FindRecord NewPos
If I was on record 8 and I click the down button then record 8 becomes record 9 and 9 become 8. I then want the cursor to be on record 9.
Am I missing something? Thanks
You don't know what you don't know...