Solved

How to move the mouse pointer in Access 2007

Posted on 2011-02-22
8
635 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
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

911 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

20 Experts available now in Live!

Get 1:1 Help Now