We investigate the effect of surface ordering on the bulk anchoring and anchoring transition of a nematic liquid crystal placed in the contact with a solid substrate. We model this situation by a simple lattice spin model in a semi-infinite geometry, where we impose the orientational distribution function (ODF) at the planar boundary. Mean field calculation, verified by Monte Carlo calculation, show that the anchoring transitions in this system are fully determined by the parameters of the imposed boundary ODF.