using a hyperlink in outlook to open a specific record in ms acces

E

EricB

Does anybody has any sample on how to open an access db and open a specific
record that is specified in the line argument of the cmd function? I have
created a routine in access that send an-email using outlook automation but
the only thing that remains is the hyperlink that needs to open a form with a
specific record specified in the line argument /cmd recid. Any hekp or
directiosn is most appreciated. Eric.
 
D

dch3

There's a command line switch that will execute a macro upon startup. You'll
need to include that and use the /cmd to pass in the information. The macro
will need to use the RunCode() function to execute whatever function you
design. Basically the function will look like this. If you have an AutoExec
macro, you may have to build in the code at that point to bypass whatever
normally happens at startup. That can be done by simply testing if a string
was passed in using the /cmd switch. In that event, you can ignore the switch
that calls a specific macro to run.

Public Function showRecordOnStartup()

DoCmd.OpenForm [formName] .... [whereStatement]

end function

I don't remember all of the parameters for .OpenForm off the top of my head
but that's pretty much it. You will need to build the where statement using a
statement such as

strWhereStatement = "[keyField] = '" & [command line string] & "'"

Again, I don't remember the specific syntax for returning the value passed
in via /cmd.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top