Morning,
I've been experimenting with unbound ADP forms using stored procedures for inserting records. And one of the things I've noticed is data validation in a bound form may not work as it did in a bound form. For example..
I have 5 unbound text boxes for collecting and storing data..
Caucasian
AfricanAmerican
Hispanic
NativeAm
Other
I have 1 unbound textbox as a calculated control that totals these amounts called ttlRace. In the control source...
=Nz([Caucasian],0) + Nz([AfricanAmerican],0) + etc.
I used to have some code in the Form Before Update event (when it was bound) that compared the ttlRace to another textbox called Enrolled....
If me.ttlRace.Value <> me.Enrolled.value then
Msgbox "Total Race must equal the amount of students enrolled."
Cancel = true
me.Caucasian.Setfocus
end if
Of course it doesn't work now because the form is unbound and the record is not inserted until a save button is clicked.
So my questions are..
What event could is use to fire this event before the record is saved?
And what advice does anyone have when dealing with data validation in unbound forms? Best Practices?
Thanks
I've been experimenting with unbound ADP forms using stored procedures for inserting records. And one of the things I've noticed is data validation in a bound form may not work as it did in a bound form. For example..
I have 5 unbound text boxes for collecting and storing data..
Caucasian
AfricanAmerican
Hispanic
NativeAm
Other
I have 1 unbound textbox as a calculated control that totals these amounts called ttlRace. In the control source...
=Nz([Caucasian],0) + Nz([AfricanAmerican],0) + etc.
I used to have some code in the Form Before Update event (when it was bound) that compared the ttlRace to another textbox called Enrolled....
If me.ttlRace.Value <> me.Enrolled.value then
Msgbox "Total Race must equal the amount of students enrolled."
Cancel = true
me.Caucasian.Setfocus
end if
Of course it doesn't work now because the form is unbound and the record is not inserted until a save button is clicked.
So my questions are..
What event could is use to fire this event before the record is saved?
And what advice does anyone have when dealing with data validation in unbound forms? Best Practices?
Thanks