Theoretical calculations and experimental measurements are used to show that hitherto neglected inertial effects can be significant in computer- controlled surface force measurement devices such as the atomic force microscope. The problem is analyzed in detail for the case of the van der Waals attraction in air. It is demonstrated that equating the cantilever deflection to the surface force systematically underestimates the magnitude of the surface force, increasingly so as the speed of approach is increased. It is also shown that the surface separation becomes lost at high accelerations due to a dynamic uncoupling of the cantilever deflection and angle. The effects of elastic deformation of the bodies are taken into account, including the collision-induced elastic vibrations in the solids. Experimental data are obtained for the van der Waals attraction and collision of glass surfaces in air using the measurement and analysis of surface forces device. All of the effects found in the theoretical calculations are identified in the experimental data.