In this paper we consider the problem of determining the weight spectrum of q-ary codes C(3,m) associated with Grassmann varieties G(3,m). For m=6 this was done by Nogin. We derive a formula for the weight of a codeword of C(3,m), in terms of certain varieties associated with alternating trilinear forms on (F_q)^m. The classification of such forms under the action of the general linear group GL(m,F_q) is the other component that is required to calculate the spectrum of C(3,m). For m=7, we explicitly determine the varieties mentioned above. The classification problem for alternating 3-forms on (F_q)^7 was solved by Cohen and Helminck, which we then use to determine the spectrum of C(3,7).