If you placed the codes in the form, then make sure you place the word "PRIVATE" infront of the API. Like this:

Code:
Private Declare Function SetCursorPos Lib "user32" Alias "SetCursorPos" (ByVal x As Long, ByVal y As Long) As Long
Drop a command button on the form and place these codes into the form too.

Code:
Private Sub Command1_Click
    SetCursorPos 100, 100
End Sub