command buttons

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
 
F

fredg

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top