Ok, after getting a chance to get in the database to find out what is wrong,
here is what is really the problem; my self-made increment feature. :-)
Private Sub Form_BeforeUpdate(Cancel As Integer)
'
If Me.NewRecord Then
'
Dim intTestCount As Integer
Dim intNextCount As Integer
Dim strCounterName As String
'
strCounterName = "invLineCount"
intTestCount = Nz(DLookup("[nxtCountInteger]", "tblCounter",
"[nxtCountName] = '" & strCounterName & "'"))
intNextCount = intTestCount + 1
[invlineId] = intNextCount
CurrentDb.Execute "UPDATE tblCounter SET nxtCountInteger = " &
intNextCount & " WHERE [nxtCountName] = '" & strCounterName & "'"
'
End If
'
End Sub
As I remember back 2 years ago, I am reminded that I created my own
'autoincrement' feature, not the internal AutoNumber system that Access has.
But it still brings us back to the problem of Integer count only allowed to
hit 32,767 and can not proceed higher. So the field it is going into is a
Long, and all is fine there it looks like, I just need to convert this
routine to use LongIntegers and be up and running.
Can I just change the routine from As Integer, to As Long; and all will be
fine?
I will verify all locations in the database where this self autoincrement
feature is used and can change the integer to long; but I will also make
sure the field where the number is being held also is set for a Long.
Any consequences I am not seeing by just changing the Integer to Long?
Tim
"Tim" <no*****@noemail.comwrote in message
news:c-******************************@comcast.com...
Hello All, I could use some help on an error that is just now popping
it's head up.
Seems that the autoincrement numeric has hit 32,767. The autoincrement is
used in various locations in the database, but in this case (log sheets),
we have hit 32k log entries over the past 2 years.
Is there a simple switch to set the autoincrement from integer to long
integer?
While I need to take care of this problem relatively quickly so that the
log sheets can be entered, I also need to solve how this error using
autoincrement will affect other areas of the database using that feature.
So hopefully it is just a matter of telling the autoincrement that it is
now a long integer instead of an integer; therefor just a blind spot I
didn't see coming 2 years ago that we would hit 32,000 entries. :-)
At least that is my hope. I did a quick google/groups search on increment
converting to long, and got a topic where the discussion was about
converting autoincrement to long, but you lose the ability to
autoincrement. That was a quick view and am still looking at other threads
to see if this really can be done. I don't want to lose AutoIncrement,
but I also have areas in the database that will also hit 32,767 entries at
some point in the future, so this has to be addressed.
Any helpful suggestions, reads, or instructions on a fix?
Tim