View Single Post
  #2 (permalink)  
Old January 12th, 2005, 02:55 PM
jbash111 jbash111 is offline
Registered User
 
Join Date: Jan 2005
Location: , , .
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Here is an example of what I have so far. This has an effect of telling the user that the sum of all the appoprtiation fields must = 100%, but it doesnt prevent the user from saving the record. It simply pops the message box up and then saves the record. This is the code for the on click event procedure of my add new record button:

Private Sub Command168_Click()
If ([GAppropriation] + [AAppropriation] + [LAppropriation] + [IAppropriation] + [SAppropriation] + [WAppropriation] + [OAppropriation]) <> 100 Then
MsgBox "Total % Appropriation must equal 100%"
Exit Sub
End If
On Error GoTo Err_Command168_Click


    DoCmd.GoToRecord , , acNewRec

Exit_Command168_Click:
    Exit Sub

Err_Command168_Click:
    MsgBox Err.Description
    Resume Exit_Command168_Click

End Sub