I have this bit of code in a routine.
CustNum is a Numeric field with a number
I need to increase by one
With the code below It comes always as 1
Could someone help with the correct code.
CustNum is a Numeric field with a number
I need to increase by one
With the code below It comes always as 1
Code:
Set Db = CurrentDb
Set rs = Db.OpenRecordset("Miracle_Cloth_Main", dbOpenDynaset)
On Error Resume Next
rs.AddNew
rs!Name = NewData
rs!Cust_ID = NewData
rs!CustNum = [CustNum] + 1
rs.Update
rs.Move 0, rs.LastModified ' Go to new record
'Me.Bookmark = rs.Bookmark ' Go to new record
'rs.Close
Could someone help with the correct code.