Re: Disable and Enable command button
- From: "NthDegree via AccessMonster.com" <u29665@uwe>
- Date: Wed, 20 Dec 2006 21:47:37 GMT
Would this do it for you?
Run this code from the "After Update" action of the list box.
if isnull(listbox) or listbox = "" then
cmdAdd.Enabled = True
cmdEdit.Enabled = False
else
cmdAdd.Enabled = False
cmdEdit.Enabled = True
end if
As a suggestion, I would put both command buttons on top of each other and
then in the code above substitute "Visible" for "Enabled". The way they would
only see the button that is appropriate for the situation.
mdavis wrote:
Form A has an unbound list box based on a query. When the list box has a
record in it I want a command button called ADD to be disabled and a command
button called EDIT to be enabled.
When their isn't a record in the list box I would like the ADD command button
to be enabled and the EDIT command button to be disabled.
--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-forms/200612/1
.
- Follow-Ups:
- Re: Disable and Enable command button
- From: mdavis via AccessMonster.com
- Re: Disable and Enable command button
- References:
- Disable and Enable command button
- From: mdavis via AccessMonster.com
- Disable and Enable command button
- Prev by Date: Re: Make Label Flash
- Next by Date: RE: Want to enable fields after combox selection
- Previous by thread: Disable and Enable command button
- Next by thread: Re: Disable and Enable command button
- Index(es):