Based on a model Hamiltonian with competing antiferromagnetic (AF) and d-wave superconductivity interactions, the vortex charge is investigated by solving the Bogoliubov-de Gennes equations. We found that the vortex charge is negative when a sufficient strength of AF order is induced inside the vortex core; otherwise, it is positive. By tuning the on-site Coulomb repulsion U or the doping parameter delta, a transition between the positive and negative vortex charges may occur. The vortex charge at optimal doping has also been studied as a function of magnetic field. Recent NMR and Hall effect experiments may be understood in terms of the present results.