Hi.
I was wondering if someone could answer this question for me??
I have a form that takes in a bunch of data. My company has all these machines that sometimes are turned off. There are 5 different reasons they can be off
lanned outage, Forced outage, Routine Inspection, Derated hours and Deactivation.
Basically the user uses a pull-down combo-box to specify which one it is. I then want Access to calculate the time and store it in the approprate field in the Master table.
This is the code I wrote for the form but it doesn't work. Any suggestions??
Private Sub Incident_Type_Change()
Select Case Me.[Incident Type]
Case "Planned outage"
Me.[Planned_outage] = Abs(DateDiff("n", [Time of fault], [Resumption time]))
Case "Forced outage"
Me.[Forced_outage] = Abs(DateDiff("n", [Time of fault], [Resumption time]))
...
...
...
... and so on for the other 3
End Select
End Sub
I also tried it with [OnUpdate]
It may also be because the user selects that type of incident BEFORE they enter in the stop and start times???
Thanks a million,
Declan
I was wondering if someone could answer this question for me??
I have a form that takes in a bunch of data. My company has all these machines that sometimes are turned off. There are 5 different reasons they can be off

Basically the user uses a pull-down combo-box to specify which one it is. I then want Access to calculate the time and store it in the approprate field in the Master table.
This is the code I wrote for the form but it doesn't work. Any suggestions??
Private Sub Incident_Type_Change()
Select Case Me.[Incident Type]
Case "Planned outage"
Me.[Planned_outage] = Abs(DateDiff("n", [Time of fault], [Resumption time]))
Case "Forced outage"
Me.[Forced_outage] = Abs(DateDiff("n", [Time of fault], [Resumption time]))
...
...
...
... and so on for the other 3
End Select
End Sub
I also tried it with [OnUpdate]
It may also be because the user selects that type of incident BEFORE they enter in the stop and start times???
Thanks a million,
Declan