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

Open form to a spedific record from external program

Status
Not open for further replies.

Mudpuppy

Technical User
Apr 11, 2000
3
US
I have managed to launch an access form from an other program (ArcView GIS)by creating a shortcut to the form and using the shortcut's path.  Is there a way to tell Access which record to open the form to from an external program?
 
OK I hope you can follow this<br><br>I use the following command line parameter to launch Access and pass a unique ID<br>In my case it was a PO number<br>&quot;C:\Microsoft Office97\Office\MSACCESS.EXE&quot; X:\Sales\-PrintPO.mdb /cmd 725909<br><br>First part is the Drive and full path to Access<br>Blank space<br>Drive and Full Path and name of Acccess database<br>Blank Space<br>/cmd<br>Blank Space<br>Unique ID which is passed to the following function<br><br>Create a Function in Access which finds your record<br>Public Function GetPO()<br>&nbsp;&nbsp;&nbsp;&nbsp;PONum = Left(command, 6)<br>&nbsp;&nbsp;&nbsp;&nbsp;GetPO = PONum<br>End Function<br><br>Create a query that has all of the fields and tables you need on your form.<br>The Criteria for your query is the function (in my case it was GetPO)<br>which looks like this in the query QBE grid<br>GetPO()<br><br>Next your forms record source is the above query<br><br>Then create an Autoexec macro that opens your form.<br><br>OK so to recap when you run the above comand line<br>1. It opens Access <br>2. loads your database<br>3. runs the autoexec macro<br> which opens the form<br> the forms recordsource is the query<br> which gets it criteria from the command line /cmd parameter<br>4. The form is setting on your specific record.<br><br>I am doing this right now so it does work.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top