okay - so I've inserted this slick little bit of code in a public function (not really ure how to link this - http://www.utteraccess.com/forum/Create-Pu...-t1980325.html)
thanks again Doug!
Public Sub Check_Required_Fields(FormReference As Form)
If IsNull(FormReference.Controls("Control1")) And FormReference.Name = "Form1" Then
MsgBox "Control1 is required."
FormReference.Controls("Control1").SetFocus
.....
ElseIf IsNull(FormReference.Controls("Control15")) And (FormReference.Name = "Form1" Or FormReference.Name = "Form2") Then
MsgBox "Control15 is required."
FormReference.Controls("Control15").SetFocus
End if
End Sub
so now, I want to call this event from my form's BeforeUpdate event.
there are two issues though...
1. if all of the required fields are populated, I need to be able to pass this info back to the form, so it will complete then next action
2. the next action may be one of three things - not simply docmd.close
I have three command buttons on the form - Add More of Same (this copies four of the control values to a new record), Add New (new record, all fields are blank), CLose form.
(the from Clos Button 'X' propert is No.)
What do I write in the BeforeUpdate event?
Do I call this code from each of the three buttons?