Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Public Function GetNewNumber(TableName As String, FieldName As String, ACount As Long) As Long
Dim rs As Recordset
Dim n As Long
On Error GoTo TableInUse
Set rs = CurrentDb.OpenRecordset(TableName, , dbPessimistic)
rs.Edit
n = rs.Fields(FieldName)
rs.Fields(FieldName) = n + ACount
rs.Update
rs.Close
GetNewNumber = n + 1
Exit Function
TableInUse:
Resume
End Function