It is always best to use properties instead of writting code. I recommend you set the Navigation Sytle property of your blocks to Change Data Block as InoL suggested.
Remember, Forms is heirarchical - meaning that navigation occurs in the order in which objects are listed in the Object Navigator. So, if the EMP block is listed before the DEPT block then, by default, EMP's next navigation block is DEPT. However if you also had the BONUS and SALGRADE blocks in your form, but only display data from EMP and DEPT then it is useful to set the the Previous Navigation Data Block and Next Navigation Data Block properties of your data blocks to ensure navigation is correct.
Hope this helps,