Access 2003 macro hangs--sendkeys not working



My object with my macro is to export data from a query in text format,
no headers, pipe-delimited, no quotes with a certain filename and
location. This action must be done multiple times a day, and to have
to do it manually all the time is tedious.

I have tried to program this macro thus:

SelectObject Object Type: Query Object Name: Query Name
RunCommand Command: Export
SendKeys Keystrokes: %ID{ENTER}%Nfilename.txt{ENTER}
Wait: Yes

The above keystrokes in the SendKeys statement are exactly what is
needed to set the export file parameters, but when I run the macro, it
always hangs when the Export dialog opens. I've read the MS
documentation that says to place the SendKeys before the command that
opens the dialog. Aside from making no sense at all to me, it hasn't
worked when I've tried it.

I would gladly avoid using SendKeys if I could, but I don't know of a
way to set the file parameters the way I need them without using it.
Could I just include the parameters of the file in the Export command

Any help would be appreciated!

Eric Gillis


suggest you read up on the TransferText action in Help, to see if it will
work for you *instead of SendKeys*, and how to set the arguments. note in
particular the mention of the Specification argument; you can create a
specfication by exporting from the database window, manually - once - and
clicking on the Advanced tab in the wizard to set up the parameters and save
them as a specification with any name you choose. then use that name as the
Specification argument in the TransferText action.


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question