Solved

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

Posted on 2002-03-18
5
121 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
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

820 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