loop through dataset and add values to clipboard

eatraas

Registered User.
Local time
Yesterday, 21:28
Joined
Jan 23, 2009
Messages
96
Hi,

i'm having difficulty with this. Messages often mention copying data from a form but does not work.

Looping through the recordset is not the problem , i want to copy the contents of a certain field to the clipboard and paste them somewhere else ( another application ).

Code:
dim rcs as recordset
set rcs = currentdb.openrecordset("pmo")

do untill rcs.eof

 ... put a field in te cliboard rcs!pmo

rcs.movenext
loop

I also need a way to empty the clipboard.

Thanks in advance

Erwin
 
hi this is not working in Access, the vbaClipboard object is not known. I've copied all the code.
 
You may need to modify if using 64 bit processor. I've not had occasion to use this functionality so can't help further.
 
Here are some other clipboard examples, not sure if they will work for your situation...
From http://bytecomb.com/copy-and-paste-in-vba/

Public Sub CopyToClip(ByVal Expression As String)
'http://bytecomb.com/copy-and-paste-in-vba/
With CreateObject(DATAOBJECT_BINDING)
.SetText Expression
.PutInClipboard
End With
End Sub

Public Function PasteFromClip() As String
'http://bytecomb.com/copy-and-paste-in-vba/
With CreateObject(DATAOBJECT_BINDING)
.GetFromClipboard
Paste = .GetText
End With
End Function

Also there is this...

http://winbatch.hpdd.de/

And then look at the section on clipboard functions, there is one about emptying the clipboard.
 

Users who are viewing this thread

Back
Top Bottom