Command button disable/enable

  • Thread starter mdavis via AccessMonster.com
  • Start date
M

mdavis via AccessMonster.com

I have the following code in a list box's After Update event and on the forms
On Current event.

If IsNull(Listbox) Or Listbox = "" Then
AddButtonMotif.Enabled = True
EditButtonMotif.Enabled = False
Else
AddButtonMotif.Enabled = False
EditButtonMotif.Enabled = True
End If

The list box is based on a query and is unbound. What I want to happen is if
there is not a value in the Listbox I would like the Add button to be enabled.
Then the user can click and a pop up form will open for them to enter a new
value. After they enter the new value and return to the main form I would
like the Add button to be disabled and the Edit button to be enabled. When
the user clicks the Edit button and the pop up form opens and the user
decides to delete the value and then they return to the main form I would
like the Add Button enabled again and the Edit button disabled.

Thank you in advance.
 
M

mdavis via AccessMonster.com

I forgot to mention that this code does not work properly. If I have a value
in the Listbox the Add button is still enabled and the Edit button is
disabled.
 

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