How to check if data has been entered on a form?

A

Amit

Hi,

I have a form with 2 buttons - "Cancel" and "Submit". I have the enable
property of "Submit" button set to "False" in FormLoad, and I would like to
change it to True as soon as the user types in data in any one of the many
controls on the form.

I tried adding "If Me.dirty then me.cmdSubmit.Enable = true End If" in the
Form's OnCurrent event, but that didn't enable the button.

Previously, I'd handled this by adding the code to enable the button in the
AfterUpdate eevent of the first control on the form, but I want to keep it
more general in case the user does not fill in that particular control first.
Also, I don't want to add the code to enable the button in multiple locations
(i.e. AfterUpdate event of all the controls on the form).

How can I fix this form to enable the button as soon as any one control is
filled with data?

Many thanks.

-Amit
 
Top