Re: Nested If problem
- From: "Jeff Boyce" <nonsense@xxxxxxxxxxxx>
- Date: Thu, 7 Jun 2007 15:23:30 -0700
de nada ... perhaps some day you'll offer support to a post you find here!
Regards
Jeff Boyce
Microsoft Office/Access MVP
"Carrie" <Carrie@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:EBBC568A-322E-4CF2-A193-55899886A903@xxxxxxxxxxxxxxxx
Hey - sorry for the repeat posts - for some reason I wasn't able to see
anything past June 5th since yesterday so, I kept trying to post thinking
that I was doing something wrong. Anyways - I've got it all figured out
now
and thank you Jeff so much for all your assistance (and patience). I
never
would have figured this out on my own!
"Carrie" wrote:
Hello Again, I'm not sure if the last 2 replies I submitted got lost, or
if
they are all going to show up at once. If they do show up - I moved past
that problem and think I am really close now.
What I can't figure out is how to get RecalcInspectionFrequency to run on
the After Update Event. I put it in as
Me.RecalcInspectionFrequency.Requery
but it doesn't like that. I think it isn't sure what
RecalcInspectionFrequency is because it isn't field. Hopefully this will
be
the last time you hear from me!
Thanks again!
"Jeff Boyce" wrote:
Carrie
You don't have to, but you do need to keep straight what the value is
in the
combo box. The value may NOT be what is displayed ... e.g., when you
hide
the first column (that's the value of the field).
Regards
Jeff Boyce
Microsoft Office/Access MVP
"Carrie" <Carrie@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:BA16AF86-159E-494B-B06E-FDC12D104C50@xxxxxxxxxxxxxxxx
Hi Jeff,
The values from the combo boxes that I have shown (1, 2, 3...) are
not
actually the ID's. The way the govt. sets these up is by Types and
Options
(ie. Type 1, Type 2, Option 1, Option 2....) so the way I have my
tables
set
up is:
RiskType_ID (PK)
Risk_Type (1,2,3...)
Risk_Description (text - kind of long)
My Risk_Type field used to have entries as Type 1, Type 2 etc. but I
kept
getting error messages and from what I could guess I thought that
Type and
Option might be reserved words so, I removed them.
Should I be using the ID's instead?
Thanks!
"Jeff Boyce" wrote:
Carrie
What isn't clear to me yet is whether those Comboboxes store the
numbers
or
the values displayed. A common approach is to "hide" the first
column
(containing the IDnumber) and display the second column (the
human-friendly
part).
It could make a difference in evaluating what they "contain".
Regards
Jeff Boyce
Microsoft Office/Access MVP
"carrietom" <carrietom@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:EE5A8F66-A777-40C1-8278-6CE32BFEBD8C@xxxxxxxxxxxxxxxx
Thanks so much for your advice - I am going to give this a try and
fingers
crossed, I'll be in business! Action, Risk_Level, Risk_Type and
Downhole_Option are all combo boxes. Action does have other
possible
selections but it is only Suspend that requires an Inspection.
Risk Type and Downhole_Option are combos where the selections are
narrowed
based on the Risk Level selected. I am using the After Update
events
to
run
that - is it acceptable to have more than one function on an
event?
I'll let you know how it turns out.
"Jeff Boyce" wrote:
Carrie
I didn't spot anything right off, but here are a couple ideas...
(I'm
assuming "Action" is a combo box - see below).
First, create a procedure behind the form that is not connected
to any
of
the controls.
Next, for readability, consider using the Select Case command,
something
like:
Private Sub RecalcInspectionFrequency()
If (Me!cboAction = Suspend) Then
Select Case Me!Risk_Level
Case "Low"
If Me!Risk_Type Between 1 and 4 Then
Me!Inspection_Frequency = 5
ElseIf Me!Risk_Type = 5 Then
Me!Inspection_Frequency = 1
Else
'?any other conditions to test
End If
Case "Medium"
If Me!Downhole_Option =1 Then
Me!Inspection_Frequency = 3
ElseIf Me!Downhole_Option Between 2 And 3 Then
Me!Inspection_Frequency =5
Else
'?are there any other option values?
End If
Case "High"
If Me!Downhole_Option =1 Then
Me!Inspection_Frequency = 1
ElseIf Me!Downhole_Option = 2 Then
Me!Inspection_Frequency =5
Else
'?are there any other option values?
End If
Case Else
Me!Inspection_Frequency =0
End Select
End If 'test "Suspend
After you create this, call it from the AfterUpdate event of
each/every
one
of the controls that contribute to the decision. That way, when
something
changes in a control, the recaculation is done.
Regards
Jeff Boyce
Microsoft Office/Access MVP
.
- References:
- Re: Nested If problem
- From: Jeff Boyce
- Re: Nested If problem
- From: Carrie
- Re: Nested If problem
- From: Jeff Boyce
- Re: Nested If problem
- From: carrietom
- Re: Nested If problem
- From: Jeff Boyce
- Re: Nested If problem
- From: Carrie
- Re: Nested If problem
- From: Jeff Boyce
- Re: Nested If problem
- From: Carrie
- Re: Nested If problem
- From: Carrie
- Re: Nested If problem
- Prev by Date: Re: OnClick Event
- Next by Date: Not In List - RowSource Conflict
- Previous by thread: Re: Nested If problem
- Next by thread: Re: Nested If problem
- Index(es):
Relevant Pages
|