T
Tony Williams
I have a form with a tab control and on update the form compares the values
of totals on two of the pages. here is the code:
'Check Advances on page 5 with page 2
totadvances = ([txtAdv0] + [txtAdv750] + [txtAdv1500] + [txtAdv7500] +
[txtAdv15000] + [txtAdv75000] + [txtAdv150000])
totadvances2 = ([txtAdvancessole] + [txtAdvancesassetssole] +
[txtAdvancesothersole] + [txtAdvancesassetspart] + [txtAdvancesotherpart] +
[txtAdvancespart] + [txtAdvancespartnp] + [txtAdvancesassetsnp] +
[txtAdvancesothernp] + [txtAdvABLdebtsole] + [txtAdvABLdebtpart] +
[txtAdvABLdebtnp] + [txtAdvABLstocksole] + [txtAdvABLstockpart] +
[txtAdvABLstocknp] + [txtAdvABLplantsole] + [txtAdvABLplantpart] +
[txtAdvABLplantnp] + [txtAdvABLpropsole] + [txtAdvABLproppart] +
[txtAdvABLpropnp] + [txtAdvABLothersole] + [txtAdvABLotherpart] +
[txtAdvABLothernp])
If totadvances <> totadvances2 Then
strMessage = strMessage & "The total of advances on Page 5 " & _
"does not equal the total of advances on Page 2" & vbCrLf & _
"It should be " & totadvances2
End If
totadvances and totadvances2 are defined as integers and the individual
fields are defined as double format in the table.
However when I move to create a new record I get an error message that says
"Error code 6 - Overflow"
Can anyone suggest a solution?
Many thanks
Tony
of totals on two of the pages. here is the code:
'Check Advances on page 5 with page 2
totadvances = ([txtAdv0] + [txtAdv750] + [txtAdv1500] + [txtAdv7500] +
[txtAdv15000] + [txtAdv75000] + [txtAdv150000])
totadvances2 = ([txtAdvancessole] + [txtAdvancesassetssole] +
[txtAdvancesothersole] + [txtAdvancesassetspart] + [txtAdvancesotherpart] +
[txtAdvancespart] + [txtAdvancespartnp] + [txtAdvancesassetsnp] +
[txtAdvancesothernp] + [txtAdvABLdebtsole] + [txtAdvABLdebtpart] +
[txtAdvABLdebtnp] + [txtAdvABLstocksole] + [txtAdvABLstockpart] +
[txtAdvABLstocknp] + [txtAdvABLplantsole] + [txtAdvABLplantpart] +
[txtAdvABLplantnp] + [txtAdvABLpropsole] + [txtAdvABLproppart] +
[txtAdvABLpropnp] + [txtAdvABLothersole] + [txtAdvABLotherpart] +
[txtAdvABLothernp])
If totadvances <> totadvances2 Then
strMessage = strMessage & "The total of advances on Page 5 " & _
"does not equal the total of advances on Page 2" & vbCrLf & _
"It should be " & totadvances2
End If
totadvances and totadvances2 are defined as integers and the individual
fields are defined as double format in the table.
However when I move to create a new record I get an error message that says
"Error code 6 - Overflow"
Can anyone suggest a solution?
Many thanks
Tony