G
Guest
Can someone tell me what is wrong with this code? I followed the
instructions from an Access source. Basically, I want a command button that
when clicked will fill in the file ReceiptNum with the next sequential
number.
Private Sub Add_Receipt_Click()
Me.ReceiptNum = "REC-" & Right(DMax("ReceiptNum", "tblReceipt"), _
Len(DMax("ReceiptNum", "tblReceipt")) - _
InStr(1, DMax("ReceiptNum", "tblReceipt"))) + 1
End Sub
instructions from an Access source. Basically, I want a command button that
when clicked will fill in the file ReceiptNum with the next sequential
number.
Private Sub Add_Receipt_Click()
Me.ReceiptNum = "REC-" & Right(DMax("ReceiptNum", "tblReceipt"), _
Len(DMax("ReceiptNum", "tblReceipt")) - _
InStr(1, DMax("ReceiptNum", "tblReceipt"))) + 1
End Sub