Hi all
I'm having a problem with enabling and disabling a command button on a form. Here goes....
I have a form that has two fields on it
Name ----- Select
(Text) -- (Yes/No)
Jonathan Yes
Sue Yes
Alison Yes
David Yes
There is a macro assigned to the AfterUpdate property on the select field called Refresh (Runcommand --> Refresh). This ensures the record count in Text14 is updated as soon as the records are selected etc.
The command button I want to enable/disable is called Command4
I have the following code set in the forms OnCurrent property
Private Sub Form_Current()
If [Text14] > 0 = True Then
Me.Command4.Enabled = True
Me.Command4.ControlTipText = "Continue"
Else
Me.Command4.Enabled = False
Me.Command4.ControlTipText = "There must be at least one search criteria included"
End If
End Sub
The problem...
If all four records are selected (Yes), the record count in Text14 = 0 BUT the command button isn't disabled until the focus is moved to the previous record or to the next record.
What am I missing??
Any help would be greatly appreciated
I'm having a problem with enabling and disabling a command button on a form. Here goes....
I have a form that has two fields on it
Name ----- Select
(Text) -- (Yes/No)
Jonathan Yes
Sue Yes
Alison Yes
David Yes
- If all four records are selected (Yes), I want to disable the command button
- If there is at least one record de-selected (No), I want the command button to be enabled.
There is a macro assigned to the AfterUpdate property on the select field called Refresh (Runcommand --> Refresh). This ensures the record count in Text14 is updated as soon as the records are selected etc.
The command button I want to enable/disable is called Command4
I have the following code set in the forms OnCurrent property
Private Sub Form_Current()
If [Text14] > 0 = True Then
Me.Command4.Enabled = True
Me.Command4.ControlTipText = "Continue"
Else
Me.Command4.Enabled = False
Me.Command4.ControlTipText = "There must be at least one search criteria included"
End If
End Sub
The problem...
If all four records are selected (Yes), the record count in Text14 = 0 BUT the command button isn't disabled until the focus is moved to the previous record or to the next record.
What am I missing??
Any help would be greatly appreciated