I have a form for estimates of giving in a church. For various reasons, we need to be able to enter the amount either as a weekly amount or a monthly amount. Once one is entered, the other will be automatically recalculated. For those instances where both already have data, I have a before update event to remind the user there is info in the opposite field and do they want to proceed with the change. Right now, if they say no, rather than having the field stay unchanged, the value is getting changed rather randomly. It seems to be going down to a single digit. Anyways, here is the code. Is there something wrong with this syntax or should it do what I describe (rather byzantinely) above?
Code: Select all
Private Sub WkAmt_BeforeUpdate(Cancel As Integer)
If Not IsNull(Me.MnthAmt) Then
If MsgBox("You already have a monthly amount entered. Do you want to change it?", vbYesNo, "Change Pledge?") = vbYes Then
Me.MnthAmt = Null
Cancel = True
The part that isn't working is Cancel = True the other side of the If statement works fine.