Early studies highlighted the fact that moving loads on beams may induce significantly higher dynamic deflections and stresses than those observed in the quasi-static case. Since then, the dynamics of beams under moving loads has been an active research area, in particular for the past decades, with the rapidly increasing computer power allowing the development of highly robust and sophisticated computational and numerical methods in applied mechanics and engineering. This work introduces a novel finite element formulation for the dynamic analysis of Euler-Bernoulli beams subjected to moving loads. The formulation is consistent with a complementary form of the well known Hamilton's variational principle, and will be used to address some numerical tests in both modal and time domains. The effectiveness and accuracy of the formulation will be assessed and discussed by comparison between the obtained results and those rendered by the standard displacement-based finite element formulation. As it will be demonstrated, the proposed formulation not only renders continuous bending-moment and shear-force distributions, a desired feature in the structural design field, but also has a superior accuracy than that provided by the displacement formulation that uses the same number of nodal degrees-of-freedom.