According to the UPC, the distance between your trap and the vent should be no more than 6 feet. In other words, for the vent to work properly, it needs to feed into the drain line within 6 feet of the trapways that connect to it.