View Full Version : Sendkeys help


jaf893
11-26-2004, 08:14 AM
I am trying to speed up the process of importing text. So far I have written a sendkeys macro which loads up the import file page. Is it possible to write a macro that loads up the import file page, waits for the user to select a file and then sends some more keys?

Thanks in advance,

JAF893

yellow
12-02-2004, 09:03 PM
Not sure exactly what you're trying to axchieve here. Are you just trying to import a file? If so rather than using sendkeys you could use a macro using TransferText or write 1 or 2 lines of code to import the file, giving you far more options.

ghudson
12-02-2004, 10:29 PM
Check this out...

Browse [Find a directory or file] (http://www.access-programmers.co.uk/forums/showthread.php?t=75790)

Do not use SendKeys.

jaf893
12-03-2004, 03:42 AM
I have downloaded your browsing database but I keep getting an error whenever I click import I get:

2391 - Field 'F1' doesn't exist in destination table 'tImport.'

ghudson
12-03-2004, 06:21 AM
That routine is just for demonstrating the import process. You can modify the table to include the fields you are trying to import and you can modify the code to import a file of your choice. My sample is hard coded to import the Win.ini file.

Maybe changing the line to...
DoCmd.TransferText acImportDelim, , "tImport", "C:\Windows\Win.txt", False
...will help.