Quantcast
Channel: Access Forms
Viewing all articles
Browse latest Browse all 103

DMax on existing record to increment serialized # fails

$
0
0
Hello and happy Cinco De'Mayo!
I have a fairly simple form that uses the BeforeUpdate event to execute thecode below.

----Access 2010----
--------------------------------------------------------
Private Sub Form_BeforeUpdate(Cancel As Integer)

If Me.NewRecord Then
If RecordsetClone.RecordCount = 0 Then
Me.IDNumber = "1"
Else
Me.IDNumber = DMax("val([IDNumber])", "Details") + 1
End If
End If
End Sub
--------------------------------------------------------

That part works perfectly for new...

DMax on existing record to increment serialized # fails

Viewing all articles
Browse latest Browse all 103

Trending Articles