skip to content »

Ms access prevent a form from updating a validated record

I have some code in the forms Before Update event that checks if a certain checkbox is checked.If it is not, I have a message appear that says "Do you wish to cancel this transaction? I want to be able to have it so that if I click no, the Before Update event is canceled and the form's close event stops so that the form remains open.

Sorry i'm in a fix here..someone be kind enough to solve my query.. Staffid Fname Lname contact and so on..i want that : " if required fields are null " the "add record " button is disabled, if all required fields are filled in then only the "add record" button should be enabled..The nice part of this is that you can set conditional requirements using the vba to set the tag property of certain controls to required if another field is updated to a value that you want to trigger an additional requirement.Of course, if you do that then you also need to initialize those tag value in the on_current event for when you switch records.The code checks to see if the item has already been selected.If it has then a message pops up telling the user about the problem.Of course, if you do that then you also need to initialize those tag value in the on_current event for when you switch records. I just need to understand how to manipulate it to my advantage.

While desiging the table, in the general tab, make the required tab as "yes" and zero length allowed as "no" that will fix your problem. Also the Status field is not required on a initial new record only if the recorded is marked Completed under the Status field.

I will attach my form with this message, so that you guys can help me better MY REQUIREMENT : 1.

If the user clicks "Add record" on a blank form directly when the form is loaded, propmt "Fields are empty" 2.

[Status] this control CAN BE EMPTY and is "not required" BUT if user selects from the control [Status]="Completed" then the control [Hours Worked] must have a value, not null before saving.

Also, if [Hours Worked] is null this is ok, as long as, the [Status] is not "Completed" After doing more research to find a solution to my problem and with a little help found a soloution.

Well.have been given an assignment, and havent been taught enough.thers no option i have to submit this assign, i have done some coding, learnt coding on my own and have made a complete database application, and thers just one thing that i need now and thts this.someone could really really help me out on this, or aaply a custom approach on this..i would be very grateful..