Generating Code in HTML Email to Open Access DB to Specific Record

C

Clint Marshall

I have an Access Database with a button that generates an HTML email.
Included in the email is a hyperlink to open another Database and go to a
specific record in a specific form.

The following text works fine as a command line from the "Run" command:
"C:\Program Files\Microsoft Office\Office10\MSAccess.exe"
"S:\FORERIVR\forerivr.mdb" /cmd frmTenant,[Tenant]=149.

I've got the HTML code reading: <a href="C:\Program Files\Microsoft
Office\Office10\MSAccess.exe" "S:\FORERIVR\forerivr.mdb" /cmd
frmTenant,[Tenant]=360>, but when I send the email and someone clicks on the
hyperlink field, everything except "C:\Program Files\Microsoft
Office\Office10\MSAccess.exe" seems to be ignores. This, of course, doesn't
get me there - all it does is open Access.

Is there any way to enter this sort of hyperlink into an email so that I can
click on the hyperlink and open the desired database, form, and record? My
guess is it's the quotes and spaces that are causing the problem, but I've
fiddled with it several different ways and all that happens is under some
instances, I open file manager, rather than Access.

If it can't be done in a hyperlink field, is there any sort of workaround
that I can email as a link?

Thank you!

-Clint Marshall
 
D

David H

Not exactly. There are start up switches that allow you to pass in the name
of a macro to run as well as arguments specific to your application - just a
generic whatever variable. You'd need to develop code that takes the custom
argument and use it in the recordsource for the form. Its somewhat straight
forward. But if you have security in place or if there are any startup
routines you'll have to factor that into the equation.

http://support.microsoft.com/default.aspx/kb/209207

You'll want to look at /macro and /cmd
 
D

David H

If I were working with this, I'd evaluate whether or not an ASP.NET page
would be appropriate.
 
D

David H

And darn it if I could only EDIT an existing post.

We're building a change notification application where in a person selects
the account, indicates the changes made and then the third person will have a
custom page showing the changes that they are authorized to approve in which
they'll just click approve.
 
C

Clint Marshall

Thanks, David!
I've got the hooks set up in the Access database to take you to the right
place if it's fed the right information.
The problem I'm having is that I can't figure out how to put the switches
into a hyperlink that's built into an email. The hyperlink (href) only seems
to interpret out to the first set of quotes, and everthing after that is
ignored. I can't find a quotation structure or other command structure that
can be used as a hyperlink. Note that when I run it from the Run command, it
works fine. It's just an issue with getting the proper hyperlink structure
to open access, open my database, and pass in the switches.
Any thoughts?
David H said:
Not exactly. There are start up switches that allow you to pass in the name
of a macro to run as well as arguments specific to your application - just a
generic whatever variable. You'd need to develop code that takes the custom
argument and use it in the recordsource for the form. Its somewhat straight
forward. But if you have security in place or if there are any startup
routines you'll have to factor that into the equation.

http://support.microsoft.com/default.aspx/kb/209207

You'll want to look at /macro and /cmd


Clint Marshall said:
I have an Access Database with a button that generates an HTML email.
Included in the email is a hyperlink to open another Database and go to a
specific record in a specific form.

The following text works fine as a command line from the "Run" command:
"C:\Program Files\Microsoft Office\Office10\MSAccess.exe"
"S:\FORERIVR\forerivr.mdb" /cmd frmTenant,[Tenant]=149.

I've got the HTML code reading: <a href="C:\Program Files\Microsoft
Office\Office10\MSAccess.exe" "S:\FORERIVR\forerivr.mdb" /cmd
frmTenant,[Tenant]=360>, but when I send the email and someone clicks on the
hyperlink field, everything except "C:\Program Files\Microsoft
Office\Office10\MSAccess.exe" seems to be ignores. This, of course, doesn't
get me there - all it does is open Access.

Is there any way to enter this sort of hyperlink into an email so that I can
click on the hyperlink and open the desired database, form, and record? My
guess is it's the quotes and spaces that are causing the problem, but I've
fiddled with it several different ways and all that happens is under some
instances, I open file manager, rather than Access.

If it can't be done in a hyperlink field, is there any sort of workaround
that I can email as a link?

Thank you!

-Clint Marshall
 
D

David H

Did Access open when you just had the .exe bit in the hyperlink? You might
have to double up on the slashes. I didn't think that it'd be an issue with
the switches. As an alternative, you may want to consider creating a short
cut and then emailing it. The code below creates it, but you'll need to
automatically pick it up and send it. Should be pretty straightforward.

FYI - Code was copied from a VBScript. Might have to make some changes for
VBA.

sub createShortcut

'The next two lines can be deleted they pertain to my specific
context in which the script is used
aSplit = split(wscript.scriptname, ".")
if Not fso.fileExists (aSplit(0) & ".lnk") then
'add Set wshShell = createObject("Wscript.shell") here
'You'll need to work with this based on your specific
situation
set newShortcut = wshShell.createShortcut
(strServerSourceFolder & "\\" & aSplit(0) & ".lnk")
newShortcut.TargetPath = WScript.ScriptFullName
newShortCut.WorkingDirectory = strServerSourceFolder
newShortcut.IconLocation = "C:\Program Files\Microsoft
Office\OFFICE11\\msaccess.exe, 0"
newShortCut.Description = "Start Trailer Management and Manifest
Database"
newShortCut.Save
end if

end sub

Clint Marshall said:
Thanks, David!
I've got the hooks set up in the Access database to take you to the right
place if it's fed the right information.
The problem I'm having is that I can't figure out how to put the switches
into a hyperlink that's built into an email. The hyperlink (href) only seems
to interpret out to the first set of quotes, and everthing after that is
ignored. I can't find a quotation structure or other command structure that
can be used as a hyperlink. Note that when I run it from the Run command, it
works fine. It's just an issue with getting the proper hyperlink structure
to open access, open my database, and pass in the switches.
Any thoughts?
David H said:
Not exactly. There are start up switches that allow you to pass in the name
of a macro to run as well as arguments specific to your application - just a
generic whatever variable. You'd need to develop code that takes the custom
argument and use it in the recordsource for the form. Its somewhat straight
forward. But if you have security in place or if there are any startup
routines you'll have to factor that into the equation.

http://support.microsoft.com/default.aspx/kb/209207

You'll want to look at /macro and /cmd


Clint Marshall said:
I have an Access Database with a button that generates an HTML email.
Included in the email is a hyperlink to open another Database and go to a
specific record in a specific form.

The following text works fine as a command line from the "Run" command:
"C:\Program Files\Microsoft Office\Office10\MSAccess.exe"
"S:\FORERIVR\forerivr.mdb" /cmd frmTenant,[Tenant]=149.

I've got the HTML code reading: <a href="C:\Program Files\Microsoft
Office\Office10\MSAccess.exe" "S:\FORERIVR\forerivr.mdb" /cmd
frmTenant,[Tenant]=360>, but when I send the email and someone clicks on the
hyperlink field, everything except "C:\Program Files\Microsoft
Office\Office10\MSAccess.exe" seems to be ignores. This, of course, doesn't
get me there - all it does is open Access.

Is there any way to enter this sort of hyperlink into an email so that I can
click on the hyperlink and open the desired database, form, and record? My
guess is it's the quotes and spaces that are causing the problem, but I've
fiddled with it several different ways and all that happens is under some
instances, I open file manager, rather than Access.

If it can't be done in a hyperlink field, is there any sort of workaround
that I can email as a link?

Thank you!

-Clint Marshall
 

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