Rajesh,
Thanks for your reply.
I see the logic. However when I click on the function e.g. Copy, from within the listbox, it is in fact copying the text "Copy" as the listbox then becomes the activecontrol, not the textbox which envoked the listbox.
It is almost as if I want the code to ignore the listbox as the activecontrol or get it to look for the previouscontrol.
Ryan
Main Topics
Browse All Topics





by: R_RajeshPosted on 2007-03-09 at 03:16:42ID: 18686386
Haven't tested it. But this should work.
.Text
.Text = MyData.GetText(1)
Dim calledControl As String 'global varible
calledControl = Me.ActiveControl.Name
ListBox1.Visible = True
Private Sub ListBox1_Click()
If ListBox1.Value = "Copy" Then
Set MyData = New DataObject
MyData.SetText Me.Controls(calledControl)
MyData.PutInClipboard
ElseIf ListBox1.Value = "Paste" Then
Set MyData = New DataObject
MyData.GetFromClipboard
Me.Controls(calledControl)
End If
ListBox1.Visible = False
End Sub