Re: Nested If problem



Hi Jeff, I must confess VB is obviously my weak point. I have inserted the
Breakpoint and tried hitting F8 but all I get is a ding from my computer -
nothing happens. Is that not how you do it?

To answer your other question, yes, I guess I do want the Inspection
Frequency to change based on any changes to any of the other fields which I
think is where part of my problem is as I can't just put my If Statement on
an After Update Event.

At this point, I'd be happy to even create a button for On Click update the
Inspection Frequency or something like that.....

"Jeff Boyce" wrote:

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




.