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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Running an Microsoft Access Macro Shortcut

Status
Not open for further replies.

zenenigma

Programmer
Apr 23, 2001
119
US
My problem comes while trying to run a Microsoft Access Macro Shortcut from VB. I've done it before, and I'm not sure what the problem is this time. I'm using the Shell("C:\macro.mam") command and it doesn't seem to recognize/find the "mam" file. I've tried using a small DOS batch file to call the .mam file, but when the batch file is run, the macro will not let me close out of the database because the macro is still open in the DOS batch file.

If there is a better way to open a "mam" file from VB, I would love to know it. It's frustrating because I've gotten the files to work before. If I'm using the wrong criteria in the "Shell" command, please let me know. I've tried doing the intVal = Shell("C:\macro.mam") and that doesn't seem to work either.
 
My current project is giving me headaches too. I am doing something similar. I am importing a text file, through VB6, into an Access 2000 table.
At this point I am stuck. I need to blank out the table. I thought of placing a copy of the table with just the structure in the mdb and doing a macro to set warnings off and copy it over top of the original, Thus making a blank table.
How did you create your MAM file?
 
Blank out the table by running a DELETE query. Basically "DELETE * FROM tblNAME" - this can be run from a macro directly, or set up as a DELETE query and then "opened" from a macro. If your clients have some version of Access installed, which I assume they do since you are running a text file import into the table, you can open MSACCESS.EXE via command-line and add the parameter "/x macroname" to run your macro. I think there is also an option to disable startup procedures as well.

--
Find common answers using Google Groups:

Corrupt MDBs FAQ
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top