Does a cmdButton have a value

T

TeeSee

Does a cmdButton have a value before a click and a different value
after a click?
I'm trying to hide a button immediately after a click but can't due to
the fact "It has focus". Could you please give me a suggestion or is
there a better way to do this?

Thanks
 
D

Dale Fye

No, command buttons do not have "values".

If you want to hide the button, you will first have to set the focus to
another control on your form. I usually create an unbound textbox
(txt_Dummy) on my forms and set its border and back style to transparent, and
width to zero. Then, you could do something like:

Private Sub cmd_Whatever_Click

me.txt_Dummy.setfocus
me.cmd_Whatever.Visible = false

end sub

You could just as easily set the focus to any other control on the form, but
I find this to be the easiest and cleanest method.

--
HTH
Dale

email address is invalid
Please reply to newsgroup only.
 

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