Hi Tina
I take it you have more than one box holding numbers ??
Your sum would work like you here it (well done for that) but you need to
reference a control on the form. So.... (oh there are other methods but these
seems to be what you're looking for)
Create a new text box and put it in the form's footer (you may have to
select View Form Footer if you can't see it)
Call the new control
txtTotalCodeWordCount
The control source for this will be
=Sum([intCodeWordCount])
Next in the AfterUpdate event of the intCodeWordCount (on the subform) put
you code but change it to something like this
Private Sub sfrmCodes_Exit(Cancel As Integer)
If Me.txtTotalCodeWordCount<> Forms!frmRequestForService!intWordCount Then
MsgBox "Word Counts are not the same", vbOKOnly, "You have made a mistake"
End If
End Sub
Hope this helps a little - let us know if you have problems
--
Wayne
Trentino, Italia.
Tina Marie said:
Hi Wayne ... the main total word count must equal the addition of all the
subform's word counts ... here's my object names:
Main form: frmRequestForService
main field: intWordCount
Subfrm: sfrmCodes
subfrm field: intCodeWordCount
So ... the intWordCount must equal the sum of all the intCodeWordCounts
...does this make sense ... let me know ... ta