I have a form with several required fields. I have created a custom message in the before update event of the field that gives the user a friendly message if any of the required fields are left null. It works fine. However, an additional error can be encountered that states "You cannot change or add a record at this time because a related record is required...." I don't really need to address this because the field that causes it is one that I've set to rquired, so my before update event already addresses it. I've captured this message number, but I'm not sure how to repress it. Any help is appreciated!
I posted a question about part of this earlier, but have since decided to delete all the code for this particular form and start over from scratch. I'm getting conflicting advice and have wrecked the code anyway from trying too many approaches. I thought I had it a few times, but I'm just confusing myself at this point. Hopefully, someone here will be willing to walk me through this step by step and hopefully I'll learn something along the way.
I have a database with a form that I would like to require data to be entered in certain fields. I would like to use the before Update event for this. I would like to check each of the 4 fields, and if any of them are null, I'd like a message telling the user this. One of these required fields is also a required record for another table, so if the user happens to leave that particular field empty, they also trigger the "Record cannot be added or changed because a related record is required..." message. I would like to completely supress and ignore that message since the Before Update event that validates data will already establish this as a required field for the user. The required fields are: strCity. strAddress, strContact, and numCounty.
Thanks so much for anyone who is wiiling to help me through this.
I posted a question about part of this earlier, but have since decided to delete all the code for this particular form and start over from scratch. I'm getting conflicting advice and have wrecked the code anyway from trying too many approaches. I thought I had it a few times, but I'm just confusing myself at this point. Hopefully, someone here will be willing to walk me through this step by step and hopefully I'll learn something along the way.
I have a database with a form that I would like to require data to be entered in certain fields. I would like to use the before Update event for this. I would like to check each of the 4 fields, and if any of them are null, I'd like a message telling the user this. One of these required fields is also a required record for another table, so if the user happens to leave that particular field empty, they also trigger the "Record cannot be added or changed because a related record is required..." message. I would like to completely supress and ignore that message since the Before Update event that validates data will already establish this as a required field for the user. The required fields are: strCity. strAddress, strContact, and numCounty.
Thanks so much for anyone who is wiiling to help me through this.
Last edited by a moderator: