Public Function GetDriverFromPath(pathID As Variant) As Long
If Not IsNull(pathID) Then
GetDriverFromPath = Nz(DLookup("driverID", "tblcarShippingPaths", "pathID = " & pathID), 0)
End If
End Function
Public Function GetPiggyBackDriver(pathID As Variant, EdgeID As Variant) As Long
Dim CurrentDriver As Long
If Not IsNull(pathID) And Not IsNull(EdgeID) Then
CurrentDriver = GetDriverFromPath(pathID)
If CurrentDriver <> 0 Then GetPiggyBackDriver = Nz(DLookup("driverID", "qrySelectPiggyback", "edgeID_FK = " & EdgeID & " AND driverID <> " & CurrentDriver), 0)
End If
End Function
Public Function GetPiggyBackTrip(pathID As Variant, EdgeID As Variant) As Long
Dim CurrentDriver As Long
If Not IsNull(pathID) And Not IsNull(EdgeID) Then
CurrentDriver = GetDriverFromPath(pathID)
If CurrentDriver <> 0 Then GetPiggyBackTrip = Nz(DLookup("tripID", "qrySelectPiggyback", "edgeID_FK = " & EdgeID & " AND driverID <> " & CurrentDriver), 0)
End If
End Function
Public Function GetNumberAvailablePiggybacks(pathID As Variant, EdgeID As Variant) As Long
Dim CurrentDriver As Long
If Not IsNull(pathID) And Not IsNull(EdgeID) Then
CurrentDriver = GetDriverFromPath(pathID)
If CurrentDriver <> 0 Then GetNumberAvailablePiggybacks = DCount("*", "qrySelectPiggyback", "edgeID_FK = " & EdgeID & " AND driverID <> " & CurrentDriver)
End If
End Function
Public Function GetTotalDeliveredFromPath(pathID As Variant) As Long
If Not IsNull(pathID) Then
GetTotalDeliveredFromPath = Nz(DLookup("SumOfCarsShipped", "qryTotalShippedPiggyBackByPath", "pathID_FK = " & pathID), 0)
End If
End Function
Public Function GetTotalPiggyBacksFromPath(pathID As Variant) As Long
If Not IsNull(pathID) Then
GetTotalPiggyBacksFromPath = Nz(DLookup("SumOfPiggyback", "qryTotalShippedPiggyBackByPath", "pathID_FK = " & pathID), 0)
End If
End Function
Public Function GetTotalPassengersFromPath(pathID As Variant) As Long
If Not IsNull(pathID) Then
GetTotalPassengersFromPath = DCount("*", "qryPiggyBackData", "DriverPath = " & pathID)
End If
End Function
Public Function GetNextDriver() As Long
GetNextDriver = Nz(DLookup("driverID", "qryNextDriver"), 0)
End Function
Public Function GetStartVertexFromEdge(EdgeID As Long) As Long
GetStartVertexFromEdge = Nz(DLookup("startVertex", "tblCarShippingEdges", "EdgeID = " & EdgeID))
End Function
Public Function GetEndVertexFromEdge(EdgeID As Long) As Long
GetEndVertexFromEdge = Nz(DLookup("EndVertex", "tblCarShippingEdges", "EdgeID = " & EdgeID))
End Function