There is no "active one". What you need is to make your function return the found object, or null if not found.
Then:
Function findtruck.truck( id$ ) For t.Truck = Each truck If truck\ID = id THen Return t End If Next Return Null End Function
Then:
blah blah t.truck = findtruck( "bigtruck" ) If t = Null Then ;handle case where not found Else x# = truck\x# etc EndIf