Re: Nested If problem



Or maybe when an "Action" is required. Not clear to me whether Action is a
field, a control, a variable or what.

"Jeff Boyce" <nonsense@xxxxxxxxxxxx> wrote in message
news:OdTmlkrpHHA.3368@xxxxxxxxxxxxxxxxxxxxxxx
Carrie

Have you tried inserting a Breakpoint at the start of the If...Then and
stepping through each command to check for values?

I'm not clear what you expect to have triggering this testing... and it
seems like you'd want to trigger it any time ANY of the fields changed.

Regards

Jeff Boyce
Microsoft Office/Access MVP

"Carrie" <Carrie@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:C7304533-A6F9-44CA-B4BC-DA3075A9AD58@xxxxxxxxxxxxxxxx
Hello Again, I have been back and forth on this one and finally gave up
on
the query idea and came back to trying a Nested If. There are basically
4
fields that need to be evaluated in order to update Inspection_Frequency
but
I can't seem to get that to happen.

I have tried this on the GotFocus, BeforeUpdate and OnEnter events, I
have
also tried it with and without the Me. Can anyone tell me what I am
doing
wrong? Thanks a million!

Private Sub Inspection_Frequency_GotFocus()
If (Action = Suspend) Then
If (Me.Risk_Level = Low) And (Me.Risk_Type = 1) Then
Me.Inspection_Frequency = 5
ElseIf (Me.Risk_Level = Low) And (Me.Risk_Type = 2) Then
Me.Inspection_Frequency = 5
ElseIf (Me.Risk_Level = Low) And (Me.Risk_Type = 3) Then
Me.Inspection_Frequency = 5
ElseIf (Me.Risk_Level = Low) And (Me.Risk_Type = 4) Then
Me.Inspection_Frequency = 5
ElseIf (Me.Risk_Level = Low) And (Me.Risk_Type = 5) Then
Me.Inspection_Frequency = 1
ElseIf (Me.Risk_Level = Medium) And (Me.Downhole_Option = 1) Then
Me.Inspection_Frequency = 3
ElseIf (Me.Risk_Level = Medium) And (Me.Downhole_Option = 2) Then
Me.Inspection_Frequency = 5
ElseIf (Me.Risk_Level = Medium) And (Me.Downhole_Option = 3) Then
Me.Inspection_Frequency = 5
ElseIf (Me.Risk_Level = High) And (Me.Downhole_Option = 1) Then
Me.Inspection_Frequency = 1
ElseIf (Me.Risk_Level = High) And (Me.Downhole_Option = 2) Then
Me.Inspection_Frequency = 5
Else: Me.Inspection_Frequency = 0
End If
End If
End Sub





.



Relevant Pages

  • Re: Me.ControlName = Something
    ... 'Set ShortName value using input box ... control, and in that event you try to move to another control or record, ... If that fails, you get an error message letting you know that the Dirty ... triggering the chain of events that must be cleared before you can continue ...
    (microsoft.public.access.formscoding)
  • Re: low-cost 1800-amp heating source
    ... hole of a toroidal 50 / 60Hz power transformer. ... Some of them do full-cycle zero-crossing burst control, ... SCR phase control is very nasty into ... This is assuming there is not mains ripple getting into the triggering ...
    (sci.electronics.design)
  • RE: Using a DropDownList in a FormView with ObjectDataSource
    ... inserting new item so no data to bind to. ... DropDownList ddlEditMode = sender as DropDownList; ... // Bind the data to the control. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: using databind on InsertItem template field
    ... There are Inserting and Inserted events you can handle from either the FormView control or from the DataSource control. ... You should then be able to modify those values as needed on the specific EventArgs. ... When Inserting a new item all fields are empty but I need the Category field to be set automatically since the user is browsing products under specific category. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Yow to Generate Unique Control ID?
    ... I am dynamically inserting multiple instances of a custom Web server control ...
    (microsoft.public.dotnet.framework.aspnet)

Loading