Any one know how to gray out buttons?

J

jjsaw5

Heres what i need to do...

I'd like to "gray out" buttons after a user clicks on it, so it is no longer
active until the user clicks another button....



Example...


User clicks the update button for a certain record

I want the update button to be grayed out until a "finalize" or "finished"
button is clicked



any ideas?



thanks!
-Justin
 
J

James

Hi

In the on click event for the update button put the following in the
VBA window:
me.[updatebuttonnname].enabled = false

Then in the on click event for the finalize button put the reverse
me.[updatebuttonnname].enabled = true

James
 
M

Mr. B

Heres what i need to do...

I'd like to "gray out" buttons after a user clicks on it, so it is no longer
active until the user clicks another button....

Example...

User clicks the update button for a certain record

I want the update button to be grayed out until a "finalize" or "finished"
button is clicked

any ideas?

thanks!
-Justin

When your user clicks the update button, first set the focus to some
other control.

In the On Click event put the following code:
Me.NameOfControl.SetFocus
'disable your update button:
Me.NameOfUpdateButton.Enabled = false

Then in the On Click event of the "finalize" button, place the
following line to again enable your update button:
Me.NameOfUpdateButton.Enabled = true

HTH

Mr. B
 
R

ruralguy via AccessMonster.com

Command buttons have an Enabled property that can be set False but the button
can not have the focus at the time. There are probably dozens of ways to
skin this cat. On method would be to set a public flag in the Click event of
the button and move the focus to another control. Then check the public flag
in this other control and disable the button if the flag is set.
 
J

jjsaw5

Thank you very much. I'll give it a try


Mr. B said:
Heres what i need to do...
[quoted text clipped - 12 lines]
thanks!
-Justin

When your user clicks the update button, first set the focus to some
other control.

In the On Click event put the following code:
Me.NameOfControl.SetFocus
'disable your update button:
Me.NameOfUpdateButton.Enabled = false

Then in the On Click event of the "finalize" button, place the
following line to again enable your update button:
Me.NameOfUpdateButton.Enabled = true

HTH

Mr. B
 
K

Klatuu

That wont quite do it, James. You cannot disable a button or any other
control while it has the focus. You must first move the focus to another
control.

--
Dave Hargis - MVP Access
James said:
Hi

In the on click event for the update button put the following in the
VBA window:
me.[updatebuttonnname].enabled = false

Then in the on click event for the finalize button put the reverse
me.[updatebuttonnname].enabled = true

James


Heres what i need to do...

I'd like to "gray out" buttons after a user clicks on it, so it is no
longer
active until the user clicks another button....

Example...

User clicks the update button for a certain record

I want the update button to be grayed out until a "finalize" or
"finished"
button is clicked

any ideas?

thanks!
-Justin
 
J

jjsaw5

I played around with it and got it to work.

Thanks very much for the help!


Command buttons have an Enabled property that can be set False but the button
can not have the focus at the time. There are probably dozens of ways to
skin this cat. On method would be to set a public flag in the Click event of
the button and move the focus to another control. Then check the public flag
in this other control and disable the button if the flag is set.
Heres what i need to do...
[quoted text clipped - 12 lines]
thanks!
-Justin
 
J

jjsaw5

I played around with it and got it to work.

Thanks very much for the help!


Command buttons have an Enabled property that can be set False but the button
can not have the focus at the time. There are probably dozens of ways to
skin this cat. On method would be to set a public flag in the Click event of
the button and move the focus to another control. Then check the public flag
in this other control and disable the button if the flag is set.
Heres what i need to do...
[quoted text clipped - 12 lines]
thanks!
-Justin
 
R

ruralguy via AccessMonster.com

Excellent! Glad we could help.
I played around with it and got it to work.

Thanks very much for the help!
Command buttons have an Enabled property that can be set False but the button
can not have the focus at the time. There are probably dozens of ways to
[quoted text clipped - 7 lines]
 

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