Dim a command button

J

John

I have a command button on a form. This button runs a
macro that sets a date. The button should only be used
when an unrelated field is null. How do I make the command
button dim when the unrelated field contains a value?
 
M

Marshall Barton

John said:
I have a command button on a form. This button runs a
macro that sets a date. The button should only be used
when an unrelated field is null. How do I make the command
button dim when the unrelated field contains a value?


You can use the unrelated text box's AfterUpdate event to
manipulate the button:

Me.button.Enabled = IsNull(Me.unrelated)

Use the same line of code in the Form's Current event to
sync the button to the field when the record is first
displayed.
 

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