A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

move mouse



 
 
Thread Tools Display Modes
  #1  
Old March 29th, 2010, 12:04 AM posted to microsoft.public.access.forms
Highlight between 3 fields[_2_]
external usenet poster
 
Posts: 26
Default move mouse

Hello
I wonder if it is possible to move the mouse when the form opens?

I Mean that when the form opens, so I want the mouse arrow moves direct to
the edge of the screen monitor instead of moving it with my hand.

Thanks
  #2  
Old March 29th, 2010, 05:13 AM posted to microsoft.public.access.forms
Tom van Stiphout[_2_]
external usenet poster
 
Posts: 1,653
Default move mouse

On Sun, 28 Mar 2010 16:04:01 -0700, Highlight between 3 fields
wrote:

Not unless you go to extremes.

-Tom.
Microsoft Access MVP


Hello
I wonder if it is possible to move the mouse when the form opens?

I Mean that when the form opens, so I want the mouse arrow moves direct to
the edge of the screen monitor instead of moving it with my hand.

Thanks

  #3  
Old March 29th, 2010, 05:40 AM posted to microsoft.public.access.forms
John W. Vinson
external usenet poster
 
Posts: 18,261
Default move mouse

On Sun, 28 Mar 2010 16:04:01 -0700, Highlight between 3 fields
wrote:

Hello
I wonder if it is possible to move the mouse when the form opens?

I Mean that when the form opens, so I want the mouse arrow moves direct to
the edge of the screen monitor instead of moving it with my hand.

Thanks


About all I can think of is to have a small textbox where you want the cursor
to appear (unbound of course), and set focus to it in the form's Load event.
--

John W. Vinson [MVP]
  #4  
Old March 29th, 2010, 11:20 AM posted to microsoft.public.access.forms
Jon Lewis[_3_]
external usenet poster
 
Posts: 40
Default move mouse

You can do this using Windows api functions. If you're not familiar with
the Windows API then Google for explanation and for what the functions I've
used do. The code below will maintain the current Y co-ordinate of the
cursor but place it at the right edge of the screen. Modify for the effect
you want.

In Declarations section of your form's Module:

Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type

Private Type POINTAPI
X As Long
Y As Long
End Type

Private Declare Function SetCursorPos Lib "user32" (ByVal X As Long, ByVal Y
As Long) As Long
Private Declare Function GetWindowRect Lib "user32" (ByVal hwnd As Long,
lpRect As RECT) As Long
Private Declare Function GetDesktopWindow Lib "user32" () As Long
Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As
Long

In your form's Load Event:

Dim pt As POINTAPI
Dim rct As RECT

GetWindowRect GetDesktopWindow, rct 'get screen coordinates of
the Desktop
GetCursorPos pt 'get
current position of cursor
SetCursorPos rct.Right, pt.Y 'move cursor
to far right of screen & current y coordinate

HTH

Jon



"Tom van Stiphout" wrote in message
...
On Sun, 28 Mar 2010 16:04:01 -0700, Highlight between 3 fields
wrote:

Not unless you go to extremes.

-Tom.
Microsoft Access MVP


Hello
I wonder if it is possible to move the mouse when the form opens?

I Mean that when the form opens, so I want the mouse arrow moves direct to
the edge of the screen monitor instead of moving it with my hand.

Thanks



  #5  
Old March 29th, 2010, 12:28 PM posted to microsoft.public.access.forms
Jon Lewis[_3_]
external usenet poster
 
Posts: 40
Default move mouse

Just thought I'd point out my first reply is directed at the OP not Tom -
the original post is not appearing on my newsreader.

Jon

"Tom van Stiphout" wrote in message
...
On Sun, 28 Mar 2010 16:04:01 -0700, Highlight between 3 fields
wrote:

Not unless you go to extremes.

-Tom.
Microsoft Access MVP


Hello
I wonder if it is possible to move the mouse when the form opens?

I Mean that when the form opens, so I want the mouse arrow moves direct to
the edge of the screen monitor instead of moving it with my hand.

Thanks



  #6  
Old March 30th, 2010, 12:35 PM posted to microsoft.public.access.forms
Highlight between 3 fields[_2_]
external usenet poster
 
Posts: 26
Default move mouse

Thank you very much

Jesus Blesses
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 02:13 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.