troubleshooting Question

How would I close a command window after starting an Access session?

Avatar of Jeffrey Davidson
Jeffrey Davidson asked on
Microsoft OfficeWindows BatchInstallationVBA
15 Comments1 Solution21 ViewsLast Modified:
I'm using a batch file to start Access and open the main form to a specific record. I'm using excel vba to write the batch file.

if exist ""C:\Program Files\Microsoft Office\Office14\MSACCESS.EXE"" (
"Q:\Development Lab Test Requests\DataBase\Development Lab Project Requests DB.accdb" /x mcrEmail /cmd 1716
goto install
) else if exist ""C:\Program Files (x86)\Microsoft Office\Office16\MSACCESS.EXE"" (
"Q:\Development Lab Test Requests\DataBase\Development Lab Project Requests DB.accdb" /x mcrEmail /cmd 1716
goto install
)

Project: 1716

Batch File To Start Access and open to the submitted request record.

Access may be either one of the applications as listed above. (office 14 or Office 16). The /x mcrEmail and the /cmd 1716 will start Access to record 1716 (this of course changes with each additional record added to the database.

I have tried adding exit in a separate line after GOTO Install and have tried adding GOTO exit and then adding :exit.

Nothing I have tried seems to work. I realize that the Access program that was started will continue to run but I was hoping to find a way of closing the batch file command window after starting the Access app on the record specified.

What should I try?
Thanks,
Jeff
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 15 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 15 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros