Rx_
Nothing In Moderation
- Local time
- Today, 12:36
- Joined
- Oct 22, 2009
- Messages
- 2,803
Trying to fix something quick for someone.
The Add New button uses : DoCmd.GoToRecord , , acNewRec
If a specific condition happens - how to totally cancel the new record - then call Sub Form_Load() that resets form back to desired state (before the Add New)?
There are 10 required fields that are enabled - must be completed before the record is written - then the rest of the non-required fields are enabled. The required fields use:
Dim bSomethingIsMissing As Boolean
bSomethingIsMissing = False
If IsNull(Me.cboReq_Fin) Then
bSomethingIsMissing = True
End If
If IsNull(Me.cboDescSHLBHL) Then
bSomethingIsMissing = True
End If ' eight more fields checked like this then ...
If bSomethingIsMissing Then
Cancel = True
There are a lot of flags set along the way.
The Form Load can't be called from within the Form_BeforeUpdate(Cancel As Integer). It generates an error.
Want to do more than undo the last field entry. Want to undo the entire ACAddNew. Then reset the entire form per the various code in the Form Load event.
The Cancel = True sill requires the user to eventually complete the required 10 fields.
The Add New button uses : DoCmd.GoToRecord , , acNewRec
If a specific condition happens - how to totally cancel the new record - then call Sub Form_Load() that resets form back to desired state (before the Add New)?
There are 10 required fields that are enabled - must be completed before the record is written - then the rest of the non-required fields are enabled. The required fields use:
Dim bSomethingIsMissing As Boolean
bSomethingIsMissing = False
If IsNull(Me.cboReq_Fin) Then
bSomethingIsMissing = True
End If
If IsNull(Me.cboDescSHLBHL) Then
bSomethingIsMissing = True
End If ' eight more fields checked like this then ...
If bSomethingIsMissing Then
Cancel = True
There are a lot of flags set along the way.
The Form Load can't be called from within the Form_BeforeUpdate(Cancel As Integer). It generates an error.
Want to do more than undo the last field entry. Want to undo the entire ACAddNew. Then reset the entire form per the various code in the Form Load event.
The Cancel = True sill requires the user to eventually complete the required 10 fields.