In this paper, a novel approach for controlling complex networks is proposed; it applies sliding-mode pinning control for a complex network to achieve trajectory tracking. This control strategy does not require the network to have the same coupling strength on all edges; and for pinned nodes, the ones with the highest degree are selected. The illustrative example is composed of a network of 50 nodes; each node dynamics is a Chen chaotic attractor. Two cases are presented. For the first case the whole network tracks a reference for each one of the states; afterwards, the second case uses the backstepping technique to track a desired trajectory for only one state. Tracking performance and dynamical behavior of the controlled network are illustrated via simulations.