|
-
September 18th, 2001, 06:07 PM
#1
Copy Datagrid With Ctrl+C
Hi,
If you run a query on ACCESS it is displayed in a datagrid. I then type Ctrl+A and Ctrl+C to copy the data from the datagrid into an Excel sheet. I was wondering how to set my VB datagrid to allow me to do the same.
Thanks,
RF
-
September 19th, 2001, 09:28 AM
#2
Re: Copy Datagrid With Ctrl+C
Hi,
Try this :
private Sub CopyGrid1ToClipboard()
With Grid1
Clipboard.Clear
Clipboard.SetText .Clip
End With
End Sub
private Sub Grid1_KeyPress(KeyAscii as Integer)
'if the user made a selection
If (Grid1.col <> Grid.ColSel) Or (Grid.row <> Grid.RowSel) then
'CTRL + C = copy
If KeyAscii = 3 then
Call CopyGrid1ToClipboard
KeyAscii = 0
Exit Sub
End If
End If
End sub
Hope it helped.
Laurent VOISIN.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|