?
Solved

How do I reference the parameter from the MS Access Macro

Posted on 2014-03-21
4
Medium Priority
?
975 Views
Last Modified: 2014-04-13
I would like to start access from command line, running a macro when the mdb starts, and pass a parameter to that macro, straight from the command line. Something like this:

"C:\Program Files\Microsoft Office\Office11\msaccess.exe" "c:\test.mdb" /x Macro_access_start "123"

The macro "Macro_access_start" would start a form that was based on query the parameter "well" to filter the data

Is this possible? How do I reference the parameter from the Macro?

Thanks!

Dallag
0
Comment
Question by:Mohammed Dallag
  • 2
  • 2
4 Comments
 
LVL 40

Expert Comment

by:als315
ID: 39947076
Look at sample. Command line should be:
"C:\Program Files\Microsoft Office\Office11\msaccess.exe" "c:\test.mdb" /x Macro_access_start /cmd "123"

Open in new window

test.mdb
0
 

Author Comment

by:Mohammed Dallag
ID: 39947360
I tried the attached access file with the command but it is not working.

"C:\Program Files (x86)\Microsoft Office\Office14\MSACCESS.EXE" "D:\test123.mdb" /x WBI  /cmd ”123”
test123.mdb
0
 
LVL 40

Accepted Solution

by:
als315 earned 2000 total points
ID: 39947410
If you a trying to open form with some criteria, you can use Where line.
Try this sample. EP_A_NUM is decimal, so you should remove quotes around parameter:
"C:\Program Files (x86)\Microsoft Office\Office14\MSACCESS.EXE" "D:\test123.mdb" /x WBI  /cmd 123
test123.mdb
0
 

Author Closing Comment

by:Mohammed Dallag
ID: 39997166
very good
0

Featured Post

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
If you’re using QODBC to update QuickBooks data from Microsoft® Access but Access is not showing the updated data, you could have set up QODBC incorrectly.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question