Some of my forms have fields I would like to be completed in all circumstances. In the tables concerned I had the required value set to 'yes' and I was receiving error messages as appropriate. I then placed some save/cancel code in the Before Update element of the form. This works fine but you can now save changes even with the mandatory fields are null. I have taken the save/change code from some of the forms where this option is not so crucial, and I receive no error messages where mandatory fields are null. Curious?
I figured it may be best to additionally prompt on each form to ensure mandatory fields are completed. I would like this to happen before any save takes place and in a sequence ie one null value at a time. I do not want to save details where records are incomplete.
I have found some code for the required info prompt whilst searching:
If IsNull(Me.ClientStatus) Then
MsgBox "ClientStatus has not been completed, please complete before proceeding"
DoCmd.GotoControl "ClientStatus"
End If
Should this go in BeforeUpdate, and if so before the save/cancel code.
What happens with the above is I get the three (have 3 potential null values) error messages in succession saying xxx field is incomplete & not allowing you to change the null - it moves to the next null - and then the save/cancel option. If you ignore the null messages & hit save, the records are saved. What I would like is the null messages to be completed sequentilly before the save/cancel option.
Probably missing something basic in my code routine.
Some pointers would help me.
Thanks
I figured it may be best to additionally prompt on each form to ensure mandatory fields are completed. I would like this to happen before any save takes place and in a sequence ie one null value at a time. I do not want to save details where records are incomplete.
I have found some code for the required info prompt whilst searching:
If IsNull(Me.ClientStatus) Then
MsgBox "ClientStatus has not been completed, please complete before proceeding"
DoCmd.GotoControl "ClientStatus"
End If
Should this go in BeforeUpdate, and if so before the save/cancel code.
What happens with the above is I get the three (have 3 potential null values) error messages in succession saying xxx field is incomplete & not allowing you to change the null - it moves to the next null - and then the save/cancel option. If you ignore the null messages & hit save, the records are saved. What I would like is the null messages to be completed sequentilly before the save/cancel option.
Probably missing something basic in my code routine.
Some pointers would help me.
Thanks