enabling and disabling command button

C

Chris

Hi All

I have a field on my main form with a choice of 2 entries
active or inactive. On my sub form which is embedded in
the main form I have a command button which I want to be
able to change to enabled if the field reads inactive and
disabled if the field reads active. I already have some
coding for other command buttons which check for null
fields so I think it would be similar ie in the on current
event for the form to check the value of the field an if
then code in the fields on open and on exit properties.
However I am unsure of the correct syntax to use.Any help
would be greatly appreciated.

Thanks

Chris
 
S

Steve Schapel

Chris,

Me.NameOfSubform!NameOfCommandButton.Enabled = _
(Me.MainFormField = "inactive")

As well as the form's On Current event, it seems to me that the
AfterUpdate event of the main form's active/inactive field would be
the other applicable event.

- Steve Schapel, Microsoft Access MVP
 

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