Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MS Access Macros

Status
Not open for further replies.

DDPMF

Technical User
Oct 25, 2005
9
US
I'm a very inexperienced user when attempting to create macros within MS Access. Would anyone be able to point me to site which provides detailed instructions on how to create a macro?

Specifically, I'm trying to create a Macro in access that does the following:

1. Imports a text file into a table from a specific directory.
2. If any errors exists in text file, display a form which will allow a user to correct a entry.
3. Run a series of queries which will produce results for a report.
4. Export the data in a specific table to a network directory.

Can anyone help?
 
You would do this in a series of steps in a new macro -
Step 1 - TransferText - options display at the bottom for the type of import, the file path, and the destination table.
Step 2 - OpenForm - you would probably need to create a form (Datasheet view?) based on your _ImportErrors table if you have one. This form may need to be created after the fact, and then this step added later.
Step 3- OpenQuery - one "OpenQuery" function in your macro for each query you are processing.
Step 4 - Once again, a TransferText function, with all the specifics added at the bottom option displays.

You might also want to start with SetWarnings "No" to start, and SetWarnings "Yes" at the end so you don't have Access reminding you you're changing a bunch of stuff.

Hope that helps
 
Thanks so much for the information. I have one additional question. The only other problem I'm experiencing is that the text files that I'm importing don't use a continous and repitive naming convention. For example, let's say I have four different files that I'd like to import:

ABC.txt
CDA.txt
EFG.txt

However, the naming convention for these files vary each time the files are saved in the folder location. Is there a MACRO in MS Access to handle this situation or a VB command to handle this siuation?

Thanks,
DDPMF
 
Leave the deprecated macro world and convert to VBA.
Then have a look at the Dir function.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top