Double click to copy/paste

MiAs

Registered User.
Local time
Today, 06:56
Joined
Oct 25, 2004
Messages
49
I am trying to set up a copy & paste by the 'double click' command from a list box to a text box.
The list box gets its data from a table with two fields which is ever changing and updated daily.
Running Acc97
I would appreciate help on this.
Example attached.
 

Attachments

Last edited:
I can't open the database - it comes up with a message about permissions and me having to join workgroups, etc. :(

Rusty
:D
 
Sorry about the example,it was created at my workplace where it is on a shared network with user permissions etc.
I will post again from home where it will be ok.
p.s. created on Acc 2000
 

Attachments

Last edited:
I inserted this bit of code, and it does what I think you want it to do:

Code:
[COLOR=DarkSlateBlue][B]Private Sub List2_DblClick(Cancel As Integer)
Dim i As Integer

[INDENT]    For i = 0 To Me.List2.ListCount - 1[/INDENT]
 [INDENT]  [INDENT]  If Me.List2.Selected(i) Then[/INDENT][/INDENT]
      [INDENT]  [INDENT]  [INDENT]      Me.Text0 = Me.List2.Column(1, i) & " " & Me.List2.Column(2, i)[/INDENT][/INDENT][/INDENT]
     [INDENT]  [INDENT]    End If[/INDENT][/INDENT]
   [INDENT] Next i[/INDENT]
End Sub[/B][/COLOR]

Let me know if it helps.
 
Last edited:
Shadow,
Thanks for the code which, as you say, works :)
How would I use this to multi select from the source list :confused:
 
Multi-select?

Do you mean that as the user double clicks more names on the list box, they will see those names add themselves to the upper text box?

If that's what you want, you can do a few things:

1) Use the code I provided, but instead of setting the value of the upper box to what you double click, you concatenate them as strings (possibly divided by a carriage return to have them appear on separate lines)

2) Consider using a list box for the top one, and double clicking the bottom will trigger an entry to the list box on top. (Hint: use the AddItem method to add the item.

Let us know how you make out.

Cheers,

SHADOW
 
Shadow,
Yes, I need to transfer more than 1 entry either individually or multi-select.
Thanks for your suggestion but I don't understand what you mean due to my lack of experience.
Could you explain in more simple terms.
 
MIA:

I recommend that you read up on listboxes, and the methods that are used to program them. It would take about 20 minutes of your time, and you'd be able to use them any way you want.

Beats asking every time.

SHADOW
 
If your intention is to store the multiple selections, think again. This would violate 1st normal form and be quite difficult to work with.
 

Users who are viewing this thread

Back
Top Bottom