Hello
I have a main form with a subform. How can i make multiple fields on the subform required fields? I would like for a messages to pop up telling the users which field is null.
Thank you
Hello
I have a main form with a subform. How can i make multiple fields on the subform required fields? I would like for a messages to pop up telling the users which field is null.
Thank you
I take it that you have the form/subform set up because you have tables that are related ina 1 to Many relationship---Is that the case?
Are the fields you are talking about required in your table design Required = Yes?
On your form you could have some sort of highlighted text that says --these fields are required,
or you could perhaps put n asterisk beside the control on the subform, or perhaps you could make the background of the
control a different color for required values.
You could check for values in these controls before you allow the user to move on.
If any of the required values is empty, have user go back to the empty control.
Just some quick comments - hope they are helpful.
I'm using this code on main form
If IsNull(Me.[Date of Service]) Then MsgBox "Please enter Date of Service!!!" Cancel = True [Date of Service].SetFocus End If
When i use this code for the fields in subform, msgbox dosn't pop up.
What's wrong with the code????
My guess is that [Date of Service] is NOT Null.
Add a debug.print [Date of Service] to confirm
You may also want to check the Len([Date of Service])