Count records in subform
Posted on 2003-11-13
I have a form that contains a textbox called "RejectNum". This form is bound to a table called Reject Main. I have a subform bound to this form called RejectSub, that is used to enter multiple rejects and their various criteria. The datasource for the subform is a table called RejectSub, and there is a one to many relationship between the two tables based on a key called UID. (probably useless info, but maybe worth adding).
Each reject has a serial number, and it is entered in a textbox called "SerialNum". I would like to force a piece of logic to prompt a msgbox when the number of rejects entered on the main form ("RejectNum") does not equal the count of serial numbers entered on the subform. In other words, if the number in the RejectNum box is 20, users should have to enter 20 serial numbers in the subform, and until they do so, they should not be able to add a record. Can someone help me with the logic here?
Thanks in advance for your help. Please let me know if the explanation has been confusing or otherwise inadequate.