Something like this....
If NumOfHours > MaxValue Then
Me.subformcontrol.Form.AllowAdditions = False
End If
There are also AllowEdits and AllowDeletions properties.
This might be of some use as well:
http://allenbrowne.com/ser-56.html
This will lock all of the controls, but still allow unbound controls to be
used. Might come in handy
hth
--
Jack Leach
www.tristatemachine.com
"I haven't failed, I've found ten thousand ways that don't work."
-Thomas Edison (1847-1931)
"Will_T" wrote:
> I have a subform that I need to lock when a fixed total of hours have
> reached. Currently, I have a hidden text box on the subform that totals the
> number of hours for a student. When the total number of hours for that
> student reaches a fixed number I need to lock the subform were it will not
> allow any new records to be added. The user may edit the records contained
> in the subform but they cannot add.
>
> Regarding the total number of hours, that value appears on the main form.
>
> What would be the best way to do this?
> --
> Will