Solved

How to move the mouse pointer in Access 2007

Posted on 2011-02-22
8
639 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
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
 
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

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

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

Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

733 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