Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Validate value in a continuous form

Status
Not open for further replies.

MikiH

Programmer
Sep 25, 2002
78
GB
Hi all

I've got a continuous form in which i am recording percentage values. In the form footer I've got a textbox calulating the total percentage using

=Sum([Percentage]) in the control source.

when I update the percentage values I requery the total percentage, no problem.

What I want to do is to ensure the total percentage value is <= 100

I've used the following in the afterupdate of the percentage control after the requery

If me!percentage >= 100 then
msgbox "percentage to high"
end if

however this isn't working because the total box hasn't updated before the if statement.

any ideas?

Thanks
Mick



 
Take a look at the ReCalc or ReQuery method.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Thanks

I've requryed the totals box, with no sucesses.
??????
 
And what about Me.Refresh ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
still no luck. the total value updates only after I've left the percentage control.

What do you think about doing a record set? summing up the percentage and then checking that value???

Thanks again
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top