Solved Checking value of all controls in a continuous form (1 Viewer)

Mike Krailo

Well-known member
Local time
Today, 01:48
Joined
Mar 28, 2020
Messages
1,044
Wouldn't this have the same issue i.e., if the user moved on to new record without having filled all three controls, they'd get an error message?
That's not an issue, it's a feature of the before update event to ensure that all three controls are filled out before each record gets saved. Usually it's for text fields that are required, but you have a very unusual form of verification. Your users may not like getting prompted to to tick a check box and be very annoyed with the idea, and I would too because it does not make sense to force a user to fill out all three of them because common sense tells users, why am I forced to click passed and put a passed date in If they haven't completed the course yet? You might want to explain to us all in what universe it makes sense to force a user to always select a boolean value or not select it if that's what you meant by verifying it. Please show us exactly what verified looks like.

With that said, a user can always cancel the entire entry of data on a new record by hitting the escape key. You can put that reminder in the msgbox that pops up to help users remember that fact. Of course this means anything they entered is erased, but now they are not trapped into the task of putting data into all three controls.

By the way, you can use the example form I provided and it will work exactly as I just described.
 

gemma-the-husky

Super Moderator
Staff member
Local time
Today, 06:48
Joined
Sep 12, 2006
Messages
15,656
I understand it is somewhat "unconventional" approach given how Access works. I was hoping there would be a way for a code to scan through all records in the underlying table and see if anything is not populated (). However, if it turns out to be impossible then I might have to change the approach
There is, but it takes time to write code to do it, and you could solve it in a much more "normal" fashion by simply verifying each record as it is entered so that you don't have to check any previous records. Are you getting error messages as you enter each record at the moment? It sounds like you must be. If you fix those errors at the time they arise, you shouldn't have any issues.
 
Last edited:

Pat Hartman

Super Moderator
Staff member
Local time
Today, 01:48
Joined
Feb 19, 2002
Messages
43,275
I enter the name and click outside that record
If you are clicking into the subform, YOU are forcing the main record to be saved. Either tab out of the control or click into the next control on the main form. You might find some enlightenment on how events work if you view these two videos and spend some time playing with the database that the videos use to show you how to correctly validate data.

 

nashaz

Member
Local time
Today, 06:48
Joined
Mar 24, 2023
Messages
111
Thank you everyone for your input. Always learn something new or expand my knowledge here. I will stick to form_beforeupdate, as suggested by pretty much everyone. Appreciate your time and effort :)
 

Users who are viewing this thread

Top Bottom