AfterUpdate() If Statement

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello

I have the below listed code in a form on the complications combobox. The default to this field is "None"
It seems such a simple problem - but I can't seem to figure out why this code does not work

Thanks In Advance

Kenny

Private Sub Complications_AfterUpdate(
If Me.Complications = "None" The
Me.RiskAssessment.Enabled = Fals
DoCmd.GoToControl "OrderRenewal
Els
DoCmd.GoToControl "RiskAssessment
End I
End Su
 
When does this "not work"? What is it doing? If you are relying on the
default value of None, I don't believe that the default value, left
unchanged, will trigger an update and so the AfterUpdate will never run.

--
Wayne Morgan
Microsoft Access MVP


KennyG said:
Hello,

I have the below listed code in a form on the complications combobox. The
default to this field is "None".
 
Wayne,

Thanks for the reply.

If the answer is none, then the Risk Assessment should have been disabled and the cursor should have moved
to Order Renewal. This did not happen.

I even tried LostFocus instead of AfterUpdate.

Any ideas and thanks again!

KennyG
 
How many columns are in the combobox? If there is more than one, what is the
Bound Column? The value of the combobox comes from the Bound Column which
may not be the column that is displayed.

Since "None" is the default, I would disable Risk Assessment by default also
and enable it in the AfterUpdate event of the combo when the value gets
changed to something other than "None". To do this, you can use the form's
Current property to check the value of the combobox each time you move from
one record to another. Also, you can detect that you are at a new record
with

If Me.NewRecord Then

--
Wayne Morgan
Microsoft Access MVP


KennyG said:
Wayne,

Thanks for the reply.

If the answer is none, then the Risk Assessment should have been disabled
and the cursor should have moved
 
Back
Top