Hello programmers,
I have a subform with the option to check off a yes/no field that when a user checks off the yes/no to equal yes it performs this operation:
Set db = CurrentDb
Set rs = db.OpenRecordset("tblCommissionsPaidSub", dbOpenDynaset)
If Me!Cleared = True Then
With rs
.AddNew
.Fields("DateofCommResidual"
= Me!PaymentsDate
.Fields("RepresentativeID"
= Forms!frmMembersEdit!RepresentativeID
.Fields("MemberID"
= Me!MemberID
.Fields("ResidualPercent"
= DLookup("Percentage", "tblPercentages", StrFilter3)
.Fields("ResidualAmount"
= ((Forms!frmMembersEdit!MemberAmount * DLookup("Percentage", "tblPercentages", StrFilter3)) / 100)
.Update
End With
Set rs = Nothing
Set db = Nothing
Else
End If
If Me!Cleared = True Then
Me!ResidualTransferred = 1
Else
Me!ResidualTransferred = 0
End If
DoCmd.DoMenuItem acFormBar, acRecordsMenu, 5, , acMenuVer70
My question is how do I delete this .addnew if the user makes a mistake and really wanted not to check off the field yes/no to no?
I have a subform with the option to check off a yes/no field that when a user checks off the yes/no to equal yes it performs this operation:
Set db = CurrentDb
Set rs = db.OpenRecordset("tblCommissionsPaidSub", dbOpenDynaset)
If Me!Cleared = True Then
With rs
.AddNew
.Fields("DateofCommResidual"
.Fields("RepresentativeID"
.Fields("MemberID"
.Fields("ResidualPercent"
.Fields("ResidualAmount"
.Update
End With
Set rs = Nothing
Set db = Nothing
Else
End If
If Me!Cleared = True Then
Me!ResidualTransferred = 1
Else
Me!ResidualTransferred = 0
End If
DoCmd.DoMenuItem acFormBar, acRecordsMenu, 5, , acMenuVer70
My question is how do I delete this .addnew if the user makes a mistake and really wanted not to check off the field yes/no to no?