What is the connection between this Pasuk, the previous one and the following one?
Rashi: Moshe is referring to the sin of Ba'al Pe'or, to point out to the people that, although his sin was not forgiven, their's was 1 (and they would enter Eretz Yisrael) - provided they obey Hashem's Mitzvos, as the Pasuk goes on to state.
Ramban: Refer to 4:5:1:1.
In similar vein perhaps, Targum Yonasan explains that they encamped in the valley, weeping (See Na'ar Yonasan) because of the sin of Ba'al Pe'or, which is why they would be allowed to enter and inherit Eretz Yisrael. Perhaps that explains the next word "ve'Atah" which often has connotaions of Teshuvah.