N
Nick Del Vecchio
I have a cmd button (filter button) that enables another button (print
preview button).
I then disable this print preview button after it is clicked by first
setting the focus to another control and then disabling the button.
That works fine.
Private Sub cmdSpecialPreview_Click()
DoCmd.OpenReport "rptPrintPreview", acViewPreview, , strWhere
cmdFilterOff.SetFocus
cmdSpecialPreview.Enabled = False
End Sub
The problem is that if the user clicks the first button (which enables
the 2nd button) and then clicks somewhere else. This keeps the second
button enabled.
I tried to disable the 2nd button in the lost focus event, but I get a
message that I can not disable a button that has focus. I don't
understand why I would get this message since I assumed it is only
supposed to fire when the button loses focus.
How can I disable this 2nd button if the next button the user clicks
is not the 2nd button?
preview button).
I then disable this print preview button after it is clicked by first
setting the focus to another control and then disabling the button.
That works fine.
Private Sub cmdSpecialPreview_Click()
DoCmd.OpenReport "rptPrintPreview", acViewPreview, , strWhere
cmdFilterOff.SetFocus
cmdSpecialPreview.Enabled = False
End Sub
The problem is that if the user clicks the first button (which enables
the 2nd button) and then clicks somewhere else. This keeps the second
button enabled.
I tried to disable the 2nd button in the lost focus event, but I get a
message that I can not disable a button that has focus. I don't
understand why I would get this message since I assumed it is only
supposed to fire when the button loses focus.
How can I disable this 2nd button if the next button the user clicks
is not the 2nd button?