AcFirst Issue

SpentGeezer

Pure Noobism
Local time
Today, 17:13
Joined
Sep 16, 2010
Messages
258
Greetings Friends,

I have a form when it opens the navigator is on 1 of 899 records. I have set up the following to try and prevent mousewheel:

Code:
Private Sub Form_MouseWheel(ByVal Page As Boolean, ByVal Count As Long)
    If Count > 0 Then
       If Not Me.Recordset.AbsolutePosition = 0 Then
            DoCmd.GoToRecord , , acPrevious
        Else
            DoCmd.GoToRecord , , acFirst
        End If
    Else
        DoCmd.GoToRecord , , acNext
    End If
End Sub
I haven't put anything in there to deal with the last record yet.

My problem: If the user is on record 1 and mousewheels down then in the code it is suppoesd to go to acfirst, however it stays on record 2 (like record 2 is acfirst??) Now record 2 is the first record. If I wheel up it goes to record 1 then back to record 2 (as it is supposed to). If I wheel down it goes to 3 and back to 2 as it is supposed to. Why doesn't this simple bit of code work for record 1??

Basically my issue = DoCmd.GoToRecord , , acFirst in the code goes to record 2 rather than record 1!
 

Attachments

Last edited:
Not Really. Requires editing to make it work. If my guys go in and start scrolling with the wheel I want it to go back to the original record
 

Users who are viewing this thread

Back
Top Bottom