In a former paper we investigated the connection between p -ary linear codes, p prime, and theta functions. Corresponding to a given code a suitable lattice and its associated theta function were defined. Using results from the theory of modular forms we got an algorithm to determine an upper bound for the minimum Lee distance of certain self-dual codes. In this note we generalize this result to m -ary codes, where m is either a power of a prime, or m is square-free. If m is of a different form the generalization will not work. A class of examples to illustrate this fact is given.