〜たとたん(に) This pattern is used to say that something unexpected happened right after an action ("the moment ~"). It describes past events you didn't control, so it is not used for your own plans.
Formation
verb た-form + とたん(に)
| 立ち上がる | 立ち上がった | 立ち上がったとたん |
| 開ける | 開けた | 開けたとたん |
| 着く | 着いた | 着いたとたん |
Examples
立ち上がったとたん、頭が痛くなった。
The moment I stood up, I got a headache.
窓を開けたとたんに、猫が外に出た。
As soon as I opened the window, the cat went outside.