@smtazulislam Validation code belongs in the FORM's BeforeUpdate event or under some conditions in the control's BeforeUpdate event. If your user doesn't use your save button, the bad data will be saved. Remember, Access also saves records when it thinks it should whether you issued a save command or not.
The form's BeforeUpdate event is the LAST event to run before a record gets saved. Think of it as the flapper at the bottom of the funnel. If the flapper is closed, the record does NOT get saved. If the flapper is open, the record gets saved. It's as simple as that. It doesn't matter what caused the record save, your validation code runs. Period. When you use other events, you need code in multiple events and you can still leave cracks. So why oh why would you not want to use the event that the Access designers designed specifically to handle validation?
It's hard for people who have never used a lower level language where you had to do everything yourself to recognize that Access is running a lot of its own code to process a form. The form itself is a class. The class code takes care of rendering the form and filling it with data and transferring the data to the table to be saved, etc. The events associated with controls and the form are hooks in the class module code so they can drop into your code to do something custom at specific points. The events are NOT RANDOM. They all have meaning and are intended for specific purposes. You will never have full control over a form no matter how much code you write if you don't put your code in the events designed to handle it. The form's BeforeUpdate event is the most important event in the entire collection of events. If you understand this ONE event, you can prevent saving invalid records.
You might want to watch this video I made with Uncle. There is a second edition coming soon where we talk about how validating using the control's events can still allow bad data to be saved which is why I always use the Form's BeforeUpdate event. It CANNOT be bypassed unless you pull the plug and in that case, the record isn't going to be saved anyway.
Bad Data is Bad for Business - Pat & Tony - Video 1
screencast-o-matic.com