Copy Data without the header (1 Viewer)

Gismo

Registered User.
Local time
Today, 08:27
Joined
Jun 12, 2017
Messages
1,298
Hi All,

I have the below code to copy data from a query

The data copied I would like to exclude the header of the query

Id this possible in any way?

DoCmd.SetWarnings False
DoCmd.RunMacro "Run Files - IW73"
DoCmd.OpenQuery "Orders List", acViewNormal, acEdit
DoCmd.SelectObject acQuery, "Orders List"

DoCmd.RunCommand acCmdSelectAllRecords

RunCommand acCmdCopy
DoCmd.Close acQuery, "Orders List", acSaveNo
MsgBox "Data copied to Clipboard"
DoCmd.SetWarnings True
 

June7

AWF VIP
Local time
Yesterday, 21:27
Joined
Mar 9, 2014
Messages
5,465
I would have to say no. What do you want to do with data?
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 01:27
Joined
Feb 19, 2002
Messages
43,223
If you want to send the data from the query someplace, there is no need to go via the clipboard. You probably want to use TransferText or TransferSpreadsheet. Both are well documented.
 

Isaac

Lifelong Learner
Local time
Yesterday, 22:27
Joined
Mar 14, 2017
Messages
8,774
As Pat said, don't use that Menu command approach ... use a method 'made' for your situation, like Transfer_
 

Gismo

Registered User.
Local time
Today, 08:27
Joined
Jun 12, 2017
Messages
1,298
I would have to say no. What do you want to do with data?
Hi,

I copy the order number then past into SAP to run stock queries

I also have a similar process where I copy all the orders for Access and past into SAP order generation

I only want to copy to clipboard
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 01:27
Joined
Feb 19, 2002
Messages
43,223
Copying a single field and pasting it is no problem. However, you are copying a recordset. I'm not even sure this would work if you could get rid of the header which you can't.

Try pasting into Excel and then copying from Excel where you can avoid copying the header.
 

Users who are viewing this thread

Top Bottom