J
Jeff Monroe
I have created a continuous that I want to increment a number (by 1
each time a record is saved. I have found when using the code below
the field increments to the next number in the new record once th
current record is saved. However, using a continuous form, it does not
When the form is first loaded it is incremented correctly, but once th
current record is updated and saved, the new record lists the numbe
that was lised on load
Can this work with continuous forms?
Thanks.
Private Sub Form_Error(DataErr As Integer, Response As Integer)
On Error GoTo Err_Form_Error
Response = IncrementField(DataErr)
Exit_Form_Error:
Exit Sub
Err_Form_Error:
MsgBox Err.Description
Resume Exit_Form_Error
End Sub
Function IncrementField(DataErr)
If DataErr = 3022 Then
Me!FA_no = DMax("FA_no", "tblFA_Log") + 1
IncrementField = acDataErrContinue
End If
End Functio
each time a record is saved. I have found when using the code below
the field increments to the next number in the new record once th
current record is saved. However, using a continuous form, it does not
When the form is first loaded it is incremented correctly, but once th
current record is updated and saved, the new record lists the numbe
that was lised on load
Can this work with continuous forms?
Thanks.
Private Sub Form_Error(DataErr As Integer, Response As Integer)
On Error GoTo Err_Form_Error
Response = IncrementField(DataErr)
Exit_Form_Error:
Exit Sub
Err_Form_Error:
MsgBox Err.Description
Resume Exit_Form_Error
End Sub
Function IncrementField(DataErr)
If DataErr = 3022 Then
Me!FA_no = DMax("FA_no", "tblFA_Log") + 1
IncrementField = acDataErrContinue
End If
End Functio