M
mfranz
Hi Everyone,
My question is, is it possible to have multiple expressions within one
Event Procedure? Here’s what I’m trying to do;
I have 5 fields – # of Crashes, # of Injuries, Crash Rate, Traffic Volume,
Injuries per Crash
Expressions
1. Traffic Volume = # of Crashes / Crash Rate
2. Injuries per Crash = # of Crashes / # of Injuries
Event Procedures (After Update)
# of Crashes
Private Sub Number_of_Crashes_AfterUpdate()
[Intersections_DataTable.Traffic Volume] = [Number of Crashes] / [Crash Rate]
[Intersections_DataTable.Number Injuries per Crash] = [Number of Injuries] /
[Number of Crashes]
End Sub
# of Injuries
Private Sub Number_of_Injuries_AfterUpdate()
[Intersections_DataTable.Number Injuries per Crash] = [Number of Injuries] /
[Number of Crashes]
End Sub
I’m trying to have Traffic Volume and Injuries per Crash auto calculate
whenever a value in # of Crashes, # of Injuries or Crash Rate change.
Right now I have expressions 1 and 2 in a Event Procedure (After Update) for
# of Crashes. I also have expression 2 in an Event Procedure (After Update)
for # of Injuries.
The problem is that it seems to only partially work correctly. When I first
created it and would enter numbers into # of Crashes the Event Procedure
would auto calculate the value for Traffic Volume just fine. Then I started
to enter numbers into the # of Injuries field which uses Expression 2, this
to seemed to work fine. But now when I enter numbers into the # of Crashes
field it will only change Injuries per Crash. For some reason it seems to be
skipping over Expression 1 and only doing Expression 2. Am I missing
something in my # of Crashes After Update Event Procedure that tells the
program to look at Expression 1 AND Expression 2. Thanks in advance for any
help you can provide.
mfranz
My question is, is it possible to have multiple expressions within one
Event Procedure? Here’s what I’m trying to do;
I have 5 fields – # of Crashes, # of Injuries, Crash Rate, Traffic Volume,
Injuries per Crash
Expressions
1. Traffic Volume = # of Crashes / Crash Rate
2. Injuries per Crash = # of Crashes / # of Injuries
Event Procedures (After Update)
# of Crashes
Private Sub Number_of_Crashes_AfterUpdate()
[Intersections_DataTable.Traffic Volume] = [Number of Crashes] / [Crash Rate]
[Intersections_DataTable.Number Injuries per Crash] = [Number of Injuries] /
[Number of Crashes]
End Sub
# of Injuries
Private Sub Number_of_Injuries_AfterUpdate()
[Intersections_DataTable.Number Injuries per Crash] = [Number of Injuries] /
[Number of Crashes]
End Sub
I’m trying to have Traffic Volume and Injuries per Crash auto calculate
whenever a value in # of Crashes, # of Injuries or Crash Rate change.
Right now I have expressions 1 and 2 in a Event Procedure (After Update) for
# of Crashes. I also have expression 2 in an Event Procedure (After Update)
for # of Injuries.
The problem is that it seems to only partially work correctly. When I first
created it and would enter numbers into # of Crashes the Event Procedure
would auto calculate the value for Traffic Volume just fine. Then I started
to enter numbers into the # of Injuries field which uses Expression 2, this
to seemed to work fine. But now when I enter numbers into the # of Crashes
field it will only change Injuries per Crash. For some reason it seems to be
skipping over Expression 1 and only doing Expression 2. Am I missing
something in my # of Crashes After Update Event Procedure that tells the
program to look at Expression 1 AND Expression 2. Thanks in advance for any
help you can provide.
mfranz