Solved

How to move the mouse pointer in Access 2007

Posted on 2011-02-22
8
634 Views
Last Modified: 2012-05-11
I need to add a code in an MS Access Form to move the mouse pointer and type some characters.
How do I do that?
0
Comment
Question by:Ehab Salem
8 Comments
 
LVL 19

Accepted Solution

by:
MINDSUPERB earned 500 total points
ID: 34958569
To move a mouse to a specific text box, you may use this code:

Me.txtYourTextBox.SetFocus

If you want your textbox automatically filled in with characters, you may type:

Me.txtYourTextBox="abc"

Sincerely,
Ed
0
 
LVL 14

Author Comment

by:Ehab Salem
ID: 34959855
And if I need to move the mouse X points left or right?
0
 
LVL 19

Expert Comment

by:MINDSUPERB
ID: 34959936
I might be wrong but I think, mouse cursor position in your screen is controlled by the mouse (hardware) through human interaction. You might not found a code for it.

The comment I posted at ID: 34958569 was in understanding that you mean the focus of your cursor on the screen. Please disregard it.

Sincerely,
Ed
0
 
LVL 119

Expert Comment

by:Rey Obrero
ID: 34960461
are you saying you want to move the cursor to a position in the textbox?
this will only be possible if the textbox have some info in it.
if the textbox is null the default position is 0

me.text0.setfocus
me.text0.selstart=4  ' will move the cursor to the fifth position
0
Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 
LVL 6

Expert Comment

by:Gugro
ID: 34960562
Can you give us some insight why you want to move the mouse some points left or right in your Access application ??
0
 
LVL 14

Author Comment

by:Ehab Salem
ID: 34960655
like a tutorial, mouse moves to a location, then some characters are typed in.
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 34965283
<like a tutorial, mouse moves to a location, then some characters are typed in.>

Then use a screen recorder:
http://www.google.com/#hl=en&sugexp=cgsisas&xhr=t&q=screen+recorder&cp=8&pf=p&sclient=psy&aq=0&aqi=&aql=f&oq=screen+r&pbx=1&bav=on.1,or.&fp=5e2b21bd614e0a97

Moving the mouse via code will be problematic as the absolute postion will also be dependent on:
The users screen resolution
The current position of the mouse
The position of the window on the screen
...etc

So in your question is is always useful for you to state why you need to do something (Your ultimate goal), in case there is a more efficient method, or a different approach.

;-)

JeffCoachman
0
 
LVL 14

Author Closing Comment

by:Ehab Salem
ID: 34991576
I used your way, no need to complicate things.
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now