Re: Nested If problem
- From: "Jeff Boyce" <nonsense@xxxxxxxxxxxx>
- Date: Mon, 4 Jun 2007 08:00:51 -0700
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
.
- Follow-Ups:
- Re: Nested If problem
- From: Carrie
- Re: Nested If problem
- From: Baz
- Re: Nested If problem
- Prev by Date: Re: splitting alpha numeric but keeping the zeroes
- Next by Date: Re: Form textbox refresh problem
- Previous by thread: #name? - Access 2007 - subform
- Next by thread: Re: Nested If problem
- Index(es):
Relevant Pages
|