Hi,
I've no experience in VBA programming and little experience with MS Access, however I've built a very simple table with several fields to keep a record of approved sub-contractors my business use.
I've created a main splash screen that a user can press a button "Add Sub-Contractor" and it opens up a blank form, as below:
I want to be able to set this form up with the following conditions:
1) The user can enter data on it that DOESN'T automatically get entered into the table.
2) When the "Back to Main" button is pressed, it will send the user back to the main splash screen WITHOUT the table being updated if there is text in any of the fields.
3) When the "Add Sub-Contractor" button is pressed, a series of validation rules are checked whcih if satisfied the data is added as a new record to the table as follows:
- 'Discipline' must be selected;
- 'Sub Contractor' name field must contain text & cannot be the same as an existing record in the table;
- 'Contact Name' must contain text;
- 'Address Line 1' must contain text;
- 'Address Line 2' must contain text;
- 'City' must contain text;
- 'Post Code' must contain text;
- 'Telephone' must contain text;
- 'E-mail' must contain a valid email;
- 'Approved (Y/N)' must be selected;
- 'Approval Date' must contain a date, and it cannot be in the future;
- 'PI Expiry' must contain a date IF 'PI Cover' is selected;
- 'EL Expiry' must contain a date IF 'EL Cover' is selected;
- 'PL Expiry' must contain a date IF 'PL Cover' is selected;
- 'Approval Review Date' must contain a date which must be in the future;
I had assumed that all of the above would be fairly simple to do with the built in validation methods in Access but it seems that because there are multiple conditions it may be something that is needed to be done in VBA.
I would be really grateful if anybody can provide me some code that can be manipulated to accommodate the above, or any help at all would be much appreciated.
Than you so much.
Spencer.