Mouse scroll wheel is creating new records (1 Viewer)

imperator

Archaeologist etc.
Local time
Today, 23:37
Joined
Feb 28, 2004
Messages
38
Hi All
I've just discovered my mouse scroll wheel is creating new blank records when I scroll and I reach and pass the last record. I'm sure it wasn't doing this earlier in the development of my database. Can someone suggest reasons why it may be doing this so I can track it down and stop it.

Many thanks
Ray
 

imperator

Archaeologist etc.
Local time
Today, 23:37
Joined
Feb 28, 2004
Messages
38
Version 2003
 

imperator

Archaeologist etc.
Local time
Today, 23:37
Joined
Feb 28, 2004
Messages
38

Thanks vbaInet, but that does not deal with the issue. I have other forms on which I can mouse scroll and when I reach the last record it just stops, nothing happens but on one form mouse scrolling to the last record and beyond is creating new (blank) records. I have no default values in fields, so cannot figure it out. If you or anyone can think of a reason for this behaviour I would be grateful.

Ray
 

vbaInet

AWF VIP
Local time
Today, 23:37
Joined
Jan 22, 2010
Messages
26,374
So you're happy with the mouse scroll to move to a new record when it reaches the end? And you just don't want blank records saved right?
Or you don't want it scrolling to a New record at all?

Does your table have a primary key?
 

imperator

Archaeologist etc.
Local time
Today, 23:37
Joined
Feb 28, 2004
Messages
38
So you're happy with the mouse scroll to move to a new record when it reaches the end? And you just don't want blank records saved right?
Or you don't want it scrolling to a New record at all?

Does your table have a primary key?

Is does have a primary key. I suppose I am happy about it moving to a new record because I have never had this problem before. A quick spin of the mouse wheel at the end of the records is creating several blank records, I'm sure this is not normal/default behaviour.

I must have enable/disabled something on this form. Properties are set to cycle current record, but this doesn't seem to have anything to do with mouse wheel, just the tab. I'm using a module to enable disable navigation buttons and other forms are using it without a problem. As I said, the records are completely blank, and I'm convinced the form wasn't originally behaving like this.



Ray
 

vbaInet

AWF VIP
Local time
Today, 23:37
Joined
Jan 22, 2010
Messages
26,374
Have you tried creating a new form? Then also create a blank database shell and imports your objects into that.

You can upload a sample db for me to look at.
 

imperator

Archaeologist etc.
Local time
Today, 23:37
Joined
Feb 28, 2004
Messages
38
Thanks for your help vbaInet, I sorted the problem by setting a couple of fields to Required (something I took away earlier for reasons I no longer recall). Now it can't go to a new record unless the previous one has data.

Ray
 

vbaInet

AWF VIP
Local time
Today, 23:37
Joined
Jan 22, 2010
Messages
26,374
Happy to hear!

You may also try this:
Code:
Option Compare Database
Option Explicit

Private isWheel As Boolean

Private Sub Form_Current()
    If Me.NewRecord Then
        If isWheel = True Then
            Me.Recordset.MoveLast
        End If
    End If
    
    isWheel = False
End Sub

Private Sub Form_MouseWheel(ByVal Page As Boolean, ByVal Count As Long)
    isWheel = True
End Sub
It would still be interesting to see why the records are being created without default values in place. Your tables could be corrupt and all you've done is mask the problem.
 

Users who are viewing this thread

Top Bottom