Hi there,
In a DB I'm working on, I have a simple subform with 3 controls, which adds a record to a table. I have a "Save & Close" button and a "Cancel" button which cancels the entry and closes the form.
One of the controls is a combobox (dropdown list linked to an underlying table), and the other two are text entry.
What I'm looking for is to have the Save button disabled until such a time as the 3 fields are all filled in. What I've managed to do so far is to have AfterUpdate events for my 3 controls which link to some code which checks:
This does work, BUT after typing in the last field, the user must press enter, or tab to another control, or click on another control to make the AfterUpdate event fire and enable the save button - i.e. when typing in the last field, they can't then just click straight on the save button, they have to click another control first, THEN the save button.
Is there any way that I can get an event to trigger with each character they type, checking that all boxes have at least one character in (ie. are not null) and enable it that way, or is the way I've currently got it the only way to do it?
In a DB I'm working on, I have a simple subform with 3 controls, which adds a record to a table. I have a "Save & Close" button and a "Cancel" button which cancels the entry and closes the form.
One of the controls is a combobox (dropdown list linked to an underlying table), and the other two are text entry.
What I'm looking for is to have the Save button disabled until such a time as the 3 fields are all filled in. What I've managed to do so far is to have AfterUpdate events for my 3 controls which link to some code which checks:
Code:
If (Not IsNull(Me.ContactTypeID)) And (Not IsNull(Me.ContactInfo)) And (Not IsNull(Me.ContactRef)) Then
Me.btnSaveClose.Enabled = True
End If
This does work, BUT after typing in the last field, the user must press enter, or tab to another control, or click on another control to make the AfterUpdate event fire and enable the save button - i.e. when typing in the last field, they can't then just click straight on the save button, they have to click another control first, THEN the save button.
Is there any way that I can get an event to trigger with each character they type, checking that all boxes have at least one character in (ie. are not null) and enable it that way, or is the way I've currently got it the only way to do it?