Hi All,
On a form, I want to disable the save button, 'cmdSave' whilst the form's mandatory fields have been left blank.
I've put in a smart tag, called, 'Req' against each required field and have used the following code on the forms current event.
The save button is disabled, but it won't enable again after each field has data entered against it.
I also have this code in the AfterUpdate event in each required field:
Any ideas?
On a form, I want to disable the save button, 'cmdSave' whilst the form's mandatory fields have been left blank.
I've put in a smart tag, called, 'Req' against each required field and have used the following code on the forms current event.
Code:
Private Sub Form_Current()
Dim ctl As Control
For Each ctl In Me.Controls
If ctl.ControlType = acTextBox Or ctl.ControlType = acComboBox Or ctl.ControlType = acListBox Then
If ctl.Tag <> "Req" Then
Exit Sub
End If
If ctl.Tag = "Req" And IsNull(ctl.Value) Then
Me.cmdSave.Enabled = False
Else
Me.cmdSave.Enabled = True
End If
End If
Next ctl
End Sub
The save button is disabled, but it won't enable again after each field has data entered against it.
I also have this code in the AfterUpdate event in each required field:
Code:
Private Sub cboErrorID_AfterUpdate()
Call Form_Current
End Sub
Any ideas?
Last edited: