open form and appropriate record from cmdline

dp111443

New member
Local time
Today, 09:28
Joined
Oct 30, 2002
Messages
7
Hi,

I am trying to open access from the command line and by passing a parameter like this:

"H:\Server.mdb" /cmd "server"

within the DB i have created an autoexec macro to runcode:

Function CheckCommandLine()

Dim ServerName

ServerName = Command()
DoCmd.OpenForm "Server", OpenArgs:=ServerName

End Function

----------------------

I know the above code is probably way out. but what im trying to do is open a form called SERVER which then opens the record that is passed in the command line (/cmd "server").

The idea is to pass a host name in the command line which then opens the appropriate record in a field called 'Host Name' in the form SERVER.

I've tried searching web and forum and Access help with no luck. Im sure someone out there has done this before.

Thanks,
dp111443
 
Never done it before, but try changing the line to this:

DoCmd.OpenForm "Server", , , , , , ServerName
 

Users who are viewing this thread

Back
Top Bottom