The binary millisecond radio pulsar PSR J1023+0038 exhibits many characteristics similar to the gamma-ray binary system PSR B1259--63/LS 2883, making it an ideal candidate for the study of high-energy non-thermal emission. It has been the subject of multi-wavelength campaigns following the disappearance of the pulsed radio emission in 2013 June, which revealed the appearance of an accretion disk around the neutron star. We present the results of very high-energy gamma-ray observations carried out by VERITAS before and after this change of state. Searches for steady and pulsed emission of both data sets yield no significant gamma-ray signal above 100 GeV, and upper limits are given for both a steady and pulsed gamma-ray flux. These upper limits are used to constrain the magnetic field strength in the shock region of the PSR J1023+0038 system. Assuming that very high-energy gamma rays are produced via an inverse-Compton mechanism in the shock region, we constrain the shock magnetic field to be greater than $sim$2 G before the disappearance of the radio pulsar and greater than $sim$10 G afterwards.