T
Tony Williams
I have a form that has a tab control with 5 pages. On Page 4 is a calculated
control (txtClientsTot) that I want to compare with a calculated control on
Page 3 (txtTotNbrClients).
I am using this code in the BeforeUpdate property of the control on Page 4
Dim totclients As Integer
Dim totnbr As Integer
totclients = ([txtClients0] + [txtClients500] + [txtClients1000] +
[txtClients5000] + [txtClients10000] + [txtClients50000] +
[txtClients100000])
totnbr = ([txtClientsdomfacsole] + [txtClientsdomidsole] +
[txtClientsexpsole] + [txtClientsimpsole] + [txtClientsdomfacpart] +
[txtClientsdomidpart] + [txtClientsexppart] + [txtClientsimppart])
If totclients <> totnbr Then
If MsgBox("Total does not agree with Total Number of Clients on Page 3" &
vbCrLf & "It should be " & [txtTotNbrClients] & " - Do you want to accept
the error?", vbYesNo, "Calculation Error") = vbNo Then
Cancel = True
End If
End If
However this doesn't work. If the incorrect total is calculated on Page 4 I
don't get any message. Can someone help please?
Thanks
Tony
control (txtClientsTot) that I want to compare with a calculated control on
Page 3 (txtTotNbrClients).
I am using this code in the BeforeUpdate property of the control on Page 4
Dim totclients As Integer
Dim totnbr As Integer
totclients = ([txtClients0] + [txtClients500] + [txtClients1000] +
[txtClients5000] + [txtClients10000] + [txtClients50000] +
[txtClients100000])
totnbr = ([txtClientsdomfacsole] + [txtClientsdomidsole] +
[txtClientsexpsole] + [txtClientsimpsole] + [txtClientsdomfacpart] +
[txtClientsdomidpart] + [txtClientsexppart] + [txtClientsimppart])
If totclients <> totnbr Then
If MsgBox("Total does not agree with Total Number of Clients on Page 3" &
vbCrLf & "It should be " & [txtTotNbrClients] & " - Do you want to accept
the error?", vbYesNo, "Calculation Error") = vbNo Then
Cancel = True
End If
End If
However this doesn't work. If the incorrect total is calculated on Page 4 I
don't get any message. Can someone help please?
Thanks
Tony