Validation of fields Question

aucho22

Registered User.
Local time
Yesterday, 21:47
Joined
Jul 4, 2014
Messages
32
Hello readers,

In my db (I am a beginner) users will add records to a table through a form in a navigation form. When the nav form opens, the cursor is not located in the fields of the sub form (first tab). Fine, the user can select other sub forms.

When the user accidentally puts its cursor in one of the fields without writing anything at all, fine, he can still select other sub forms in the nav form.

My problem:
However, let's say, my user starts writing in the sub form and then realizes that he/she made a mistake and wants to check in the "search" sub form something or perform another action. In this case, he/she will not be able to do so without having to close the nav form or db because I put a code on the sub form (Before Update, from this useful website http://www.databasedev.co.uk/validate_textbox.html )

Everytime he would try to simply go to the other tab, it would pop up the error message from the code. Even if he erases what he wrote in the beginning. This code checks that some of the fields are filled correctly before adding the record to the table.

Question:
I think this is me being picky but I am trying to make this form as user friendly as possible... Is there any way to correct my problem?

I did find that this code alternative was better than setting "Required" to yes in the chosen fields at the table level which was not giving a very user friendly message.

Any guidance is well appreciated!
Thank you,
Aucho22
 
Last edited:
The issue with sub-forms is that if they are bound in a "traditional" sense (where the sub-form is bound to a child table and the parent form is bound to a parent table), the sub-form probably will not allow updating unless the parent form is updated first due to relational integrity issues.

Granted, it is a pain in the tailbone to do it another way, but if you absolutely want free-form navigation, NONE of the parent and child forms can actually be bound, and you would then have to have a lot of extra code behind each control to make it stay self-consistent. I wish it weren't so nasty, because I have some times when I need to do that, too.

In essence, if you use bound parent/child tables, you are immediately bound to the rules that govern parent/child tables including the requirement that a parent exists before a child can exist.
 
Thank you Doc_Man for the reply!

I think I will stick to my current form then! :o

Aucho22
 
If anyone is in need of a "quick" solution...

I simply added a command button (Undo Record from the wizard) to cancel data entry, which then allows the user to go to another tab without the "Missing field" message popping up.

Aucho22
 

Users who are viewing this thread

Back
Top Bottom