By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,959 Members | 1,243 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,959 IT Pros & Developers. It's quick & easy.

Using VBA to direct required fields

P: 19
Hello - I am building a database that will have four different Action Types (Change, Recruitment, Losses, Fee) - basically four different forms in one. I'm trying to figure out how to write VBA so that when a particular action type is selected those fields for that specific action are then made "Is Not Null". There are a total of 34 Required fields: Change requires 33, Recruitment 22, Fee 18, and Losses 24 - some are used for all Action Types and some stand alone on a form. I'm thinking of this - If the user chooses the Change action type, then I want the VBA to tell the form what fields for that specific type are required.

I hope this helps with what I'm thinking - please let me know if I need to be more clear.

Laura Edmark
Jan 23 '08 #1
Share this Question
Share on Google+
1 Reply


P: 62
Hello - I am building a database that will have four different Action Types (Change, Recruitment, Losses, Fee) - basically four different forms in one. I'm trying to figure out how to write VBA so that when a particular action type is selected those fields for that specific action are then made "Is Not Null". There are a total of 34 Required fields: Change requires 33, Recruitment 22, Fee 18, and Losses 24 - some are used for all Action Types and some stand alone on a form. I'm thinking of this - If the user chooses the Change action type, then I want the VBA to tell the form what fields for that specific type are required.

I hope this helps with what I'm thinking - please let me know if I need to be more clear.

Laura Edmark

I did something similar to this very recently. I structured it as a primary combo box choosing the class of action (in your case Change, Recruitment, Fee Losses) the value of which changes the [control_name].Visible property of my secondary search criteria to yes or no.

Alternatively you can use the "tab control" options in the Design View of your form. Simply click the "tab control" button then drag an area in your form. Cut/Paste your controls into the tab you wish those controls to belong to. Note: If you have any fields that are shared between all tabs you should leave them outside of the tab box.

Hope this helps.
Jan 28 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.