A new and fast method to fix integer ambiguity of GPS carrier phase measurement on-the-fly is proposed. The method is distinguished from other methods in that the relationship between integer ambiguities is found and used in a constraint equation for fixing integer ambiguity. Thus the method does not require positioning for every candidate and only three independent elements of the integer ambiguities are searched; the remaining dependent elements can be obtained from the constraint equation. This may greatly reduce the computational burden. Accurate relative positioning on a move also can be accomplished by adopting the proposed method. The technique is applied to two different types of real data to show its effectiveness. Experimental results show that the proposed method is fast and efficient for relative positioning of a moving user. The method may be used in areas requiring accurate positioning such as navigation and geodesy.