Field must have an entry

I have a SW form with a field that must have an entry.

How do I ensure that this happens and that the form cannot be closed if the field is blank?

SolidworksApi macros