command buttons

  • Thread starter Thread starter koko
  • Start date Start date
K

koko

i have a command button that i want to disable when the
user clicks on it. currently, on the onclick property i
declared the event procedure below but i am getting an
error saying i cannot disable a control while on focus.
how do i correct this?

Private Sub Command58_Click()
Me!Command58.Enabled = False
End Sub

thanks for your reply in advance
 
koko said:
i have a command button that i want to disable when the
user clicks on it. currently, on the onclick property i
declared the event procedure below but i am getting an
error saying i cannot disable a control while on focus.
how do i correct this?

Private Sub Command58_Click()
Me!Command58.Enabled = False
End Sub

thanks for your reply in advance

Set the focus elsewhere first.

[SomeControl].SetFocus
Me!Command58.Enabled = false
 
Back
Top