Last record in the Table

mardi 28 avril 2015

I have "total" query that finds the last number in a table and it has just one field in the table - so when I create anew record i want to look up the last no then add one and then create a new record. The code works in onw query but not in another - - - any ideas guys?


Dim stDocName As String
Dim stLinkCriteria As String
Dim NewStationeryNo As Double

' ------------------------------find last No

NewNo = DCount("*", "qryStationeryLastNo")

NewStationeryNo = DCount("*", "qryStationeryLastNo") + 1
MsgBox "New no " & NewStationeryNo
Last record in the Table

0 commentaires:

Enregistrer un commentaire

Labels