Lanason
Registered User.
- Local time
- Today, 22:37
- Joined
- Sep 12, 2003
- Messages
- 258
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
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