C
Chris Nebinger
If you are relying on opening the table with no sort
order, but rather relying on the table sort order, you
could end up with this problem. Also, it seems expensive
to open an entire table to get the results of one record.
I would replace
Set rst = db.OpenRecordset("tblNotices")
rst.MoveLast
with:
Set rst = db.OpenRecordset("Select Top 1 Issue_Num from
tblNotices ORDER BY Issue_Num DESC")
If rst.EOF then
intLast = 0
Else
If Left(rst!Issue_Num, 6) = Format(Date, "yyyymm") Then
intLast = Right(rst!Issue_Num, 4)
Else
intLast = 0
End If
End If
intNew=intLast + 1
Chris Nebinger
order, but rather relying on the table sort order, you
could end up with this problem. Also, it seems expensive
to open an entire table to get the results of one record.
I would replace
Set rst = db.OpenRecordset("tblNotices")
rst.MoveLast
with:
Set rst = db.OpenRecordset("Select Top 1 Issue_Num from
tblNotices ORDER BY Issue_Num DESC")
If rst.EOF then
intLast = 0
Else
If Left(rst!Issue_Num, 6) = Format(Date, "yyyymm") Then
intLast = Right(rst!Issue_Num, 4)
Else
intLast = 0
End If
End If
intNew=intLast + 1
Chris Nebinger