Solved

Global detection of active control when text is pasted to a control

Posted on 2002-03-18
5
123 Views
Last Modified: 2010-05-02
There are a set of controls including Text Boxes in a Form.

I am pasting a text onto a Text Box using Mouse/Ctrl+V. Is there any way can the Form Identify in which Control/Text Box the value has been pasted. Can I access the value which has been pasted ?
Is there any API Event or Function through which it can be detected.
0
Comment
Question by:alramanathan
[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
5 Comments
 
LVL 43

Accepted Solution

by:
TimCottee earned 10 total points
ID: 6876778
Easy if you use the Text1_Change event or similar for each control that you could paste into.
0
 
LVL 28

Expert Comment

by:AzraSound
ID: 6876979
If you set the form's KeyPreview property to True, you could use something like this, as an example of the code to implement:


Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
    If (Shift And vbCtrlMask) Then
        If KeyCode = Asc("V") Or KeyCode = Asc("v") Then
            MsgBox "Text pasted into " & Me.ActiveControl.Name & _
                vbCrLf & vbCrLf & "Text pasted: " & Chr(34) & _
                Clipboard.GetText & Chr(34)
        End If
    End If
End Sub
0
 
LVL 15

Expert Comment

by:ameba
ID: 6877635
alramanathan, please, give FEEDBACK in your other question

http://www.experts-exchange.com/jsp/qShow.jsp?ta=visualbasic&qid=20276373



0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7634133
Hi alramanathan,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Accept TimCottee's comment(s) as an answer.

alramanathan, if you think your question was not answered at all or if you need help, just post a new comment here; Community Support will help you.  DO NOT accept this comment as an answer.

EXPERTS: If you disagree with that recommendation, please post an explanatory comment.
==========
DanRollins -- EE database cleanup volunteer
0
 
LVL 1

Expert Comment

by:kodiakbear
ID: 7665958
Moving to the paq

kb
Experts Exchange Moderator
0

Featured Post

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

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

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

724 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