途中で indicates that the action/event represented by V takes place while moving from one place to another. The other motion verbs 来る(come) and 帰る(return) can also be used.
When these motion verbs are used within a sentence(i.e., immediately before 途中で), they are always in the dictionary form.
I had an accident on my way to school.
VN includes such action nouns as 帰国(return to one's home country), 旅行(travel), and 散歩(walk [for pleasure]).
駅へ行きます。その途中で、銀行に寄ります。
I'm going to the station. On my way [to the station], I'll stop by the bank.
駅へ行く途中で、銀行に寄ります。
On my way to the station, I'll stop by the bank.