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 Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Real Chalenge, "Validation" of Field on Subform 1

Status
Not open for further replies.

bocaboca

Technical User
Apr 11, 2002
3
AU
Situation: Two tables. Relation One-To-Many. Form and one subform. Few fields on form. One field on subform (non linked one).

Goal: Prevent leaving entering the new record on form (consequently Record updating in table) if field on the subform IsNull=True.

Problem 1: Can't use BeforeUpdate Event for cheking value of field on subform and DoCmd.CancelEvent because it will make unpossible entering data in the subform field.

Problem 2: Dont want to use Public Variable (flag, CurrentRecord ...) because of multiuser environment and problems with Public Variable integrity.

Problem 3: I can make new Field in subform related table which will be filled on entering new record on the form. Consequently on entering new record in form, new record in other table will be created which will enable automated "validation" of "Required" field in the table (field on subform). In this scenario I dont know were to put error traping procedure in order to prevent poping out of Warnings and handling error.


Open to other solutions.

Thanks
 
You would put the trapping in the Form's Error Event, I'm not sure which numbers to trap, but use debug.print dataerr in this event and then set the Response = acDataErrContinue.
--Jim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top