B
Bongard
I am trying to allow the user to make multiple entries on a form
(numerical) that must sum to zero. This is what I have VBA to validate
this before the button can be clicked
Private Sub Form_BeforeUpdate(Cancel As Integer)
'If SumOfTotalPrice must be =0:
If Me.sum <> 0 Then
MsgBox " Sum of Total Entries must be
equal to 0." & vbCrLf & "Please check to make sure that you have
entered the right dollar amounts"
'Set cancel to true so no update to the table
Cancel = True
End If
End Sub
Right now, it won't work when I click the "add record" button and it
did in the past. What screwed it up was that I also wanted to run an
append query using this same button but couldn't figure out how to do
it. Can someone help me at least get this formula working again as a
check for the button so that the records cannot be added to the table
until the amounts sum to 0. Also, if anyone knows how I would greatly
appreciate if you would help me get the append query macros working as
well.
Thanks a lot!
(numerical) that must sum to zero. This is what I have VBA to validate
this before the button can be clicked
Private Sub Form_BeforeUpdate(Cancel As Integer)
'If SumOfTotalPrice must be =0:
If Me.sum <> 0 Then
MsgBox " Sum of Total Entries must be
equal to 0." & vbCrLf & "Please check to make sure that you have
entered the right dollar amounts"
'Set cancel to true so no update to the table
Cancel = True
End If
End Sub
Right now, it won't work when I click the "add record" button and it
did in the past. What screwed it up was that I also wanted to run an
append query using this same button but couldn't figure out how to do
it. Can someone help me at least get this formula working again as a
check for the button so that the records cannot be added to the table
until the amounts sum to 0. Also, if anyone knows how I would greatly
appreciate if you would help me get the append query macros working as
well.
Thanks a lot!