JGalletta
Windows 7 Access 2010
- Local time
- Today, 08:48
- Joined
- Feb 9, 2012
- Messages
- 149
I have a form containing two sub forms. These forms contain boxes that are bound to tables which contain required fields (as defined in the table design). On entering/exiting form/subform focuses, a warning is displayed if the required fields in each form/subform are empty/null.
A few ways I'm envisioning to suppress these warnings:
1.) On form open event, setwarnings false. (Will this suppress that type of warning?) Subsequently, setwarnings true on closing. - What I don't like is that other warnings may not appear as well (is this true, too?).
2.) Change required to no for all fields. On form close event, check for nulls in form table and sub tables with matching primary keys relevant to the form, and display msgbox "Warning..." if nulls are found and exit sub.
3.) Your idea here.
Questions:
Case 1
Will this work? Will setwarnings false cover warnings on both form and sub forms. Is there a way to suppress only the "Required Fields" warning for these forms?
Case 2
If this is the option, what is the procedure for creating a recordset of all fields on a form (and sub form) and looping to check for nulls/blanks?
Case 3
What do you guys think?
A few ways I'm envisioning to suppress these warnings:
1.) On form open event, setwarnings false. (Will this suppress that type of warning?) Subsequently, setwarnings true on closing. - What I don't like is that other warnings may not appear as well (is this true, too?).
2.) Change required to no for all fields. On form close event, check for nulls in form table and sub tables with matching primary keys relevant to the form, and display msgbox "Warning..." if nulls are found and exit sub.
3.) Your idea here.
Questions:
Case 1
Will this work? Will setwarnings false cover warnings on both form and sub forms. Is there a way to suppress only the "Required Fields" warning for these forms?
Case 2
If this is the option, what is the procedure for creating a recordset of all fields on a form (and sub form) and looping to check for nulls/blanks?
Case 3
What do you guys think?