I have the following code on a form to update the receipt number:-
Dim rs As DAO.Recordset
Set rs = CurrentDb.OpenRecordset("SELECT recNum FROM table2")
NextNo = rs!RECNUM + 1
'now update the table
rs.Edit
rs!RECNUM = NextNo
rs.Update
rs.Close
Set rs = Nothing
What do i have to ad to this so that when i cancel a form it doesn't increase the number?
Many Thanks
Dim rs As DAO.Recordset
Set rs = CurrentDb.OpenRecordset("SELECT recNum FROM table2")
NextNo = rs!RECNUM + 1
'now update the table
rs.Edit
rs!RECNUM = NextNo
rs.Update
rs.Close
Set rs = Nothing
What do i have to ad to this so that when i cancel a form it doesn't increase the number?
Many Thanks