enabling and disabling command button

  • Thread starter Thread starter Chris
  • Start date Start date
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
 
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
 
Back
Top