I have been working on this for the past couple of days and seem to have hit a stone wall.
I have a form that is used to add a new customer/relationship. The four fields on this form are RelID, RelName,CostCenter & RelationshipManager. All of these are required and cannot be null.
I have code on each of these text boxes in the before update section that looks like this.
If IsNull (Me![FieldName]) Then
MsgBox "Please remember to enter blah blah blah"
DoCmd.Cancel Event
End If
End Sub.
When I use this it does not work!
After reading some of the posts in this forum I realized that I could do this in the before update section of the form itself.
My question is, do I have to do a different If IsNull event for each required field or can I include all of my required items on one If IsNull statement?
Also, when I did a test with the "before update" section of the form (with one field), it was able to capture the fact that the field had a null value, but immediately following my message box, came the standardized access message that says the primary key cannot contain a null value. Is there any way to fix this?
I hope I explained myself well, code is new to me and don't have my terminology down straight yet.
Thanks
I have a form that is used to add a new customer/relationship. The four fields on this form are RelID, RelName,CostCenter & RelationshipManager. All of these are required and cannot be null.
I have code on each of these text boxes in the before update section that looks like this.
If IsNull (Me![FieldName]) Then
MsgBox "Please remember to enter blah blah blah"
DoCmd.Cancel Event
End If
End Sub.
When I use this it does not work!
After reading some of the posts in this forum I realized that I could do this in the before update section of the form itself.
My question is, do I have to do a different If IsNull event for each required field or can I include all of my required items on one If IsNull statement?
Also, when I did a test with the "before update" section of the form (with one field), it was able to capture the fact that the field had a null value, but immediately following my message box, came the standardized access message that says the primary key cannot contain a null value. Is there any way to fix this?
I hope I explained myself well, code is new to me and don't have my terminology down straight yet.
Thanks