R
red6000
Hi,
I have a button which open my InputForm using the 'OpenForm' action and
'Add' datamode so that I can only add a new records to my table.
The Input Form has various Text Box's (for arguments sake named TextBox1 to
5).
I have disabled the 'close' button on the form and have a command button
which run's the standard close form macro.
However what I would like to do is instead of using the default close form
macro is to have VBA code that:
****Strart Code
If TextBox1.Value = "yes" and TextBox2.value="" and TextBox3.value="" and
TextBox4.value="" and TextBox5.value="" then
MsgBox = ("You must enter at least one value in TB 2 to 5")
Exit Sub
End if
InputForm.Close
****End Code
Is this possible. What concerns me (and why I'm not sure what to do) is
what if the user has input more than one new record, how can I write the
code to validate new each record? Perhaps the code needs to also be on the
event of clicking the NewRecord button?
Hope that makes sense.
Thanks for any help or advice.
I have a button which open my InputForm using the 'OpenForm' action and
'Add' datamode so that I can only add a new records to my table.
The Input Form has various Text Box's (for arguments sake named TextBox1 to
5).
I have disabled the 'close' button on the form and have a command button
which run's the standard close form macro.
However what I would like to do is instead of using the default close form
macro is to have VBA code that:
****Strart Code
If TextBox1.Value = "yes" and TextBox2.value="" and TextBox3.value="" and
TextBox4.value="" and TextBox5.value="" then
MsgBox = ("You must enter at least one value in TB 2 to 5")
Exit Sub
End if
InputForm.Close
****End Code
Is this possible. What concerns me (and why I'm not sure what to do) is
what if the user has input more than one new record, how can I write the
code to validate new each record? Perhaps the code needs to also be on the
event of clicking the NewRecord button?
Hope that makes sense.
Thanks for any help or advice.