469,315 Members | 1,866 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,315 developers. It's quick & easy.

Email Item as Link from Access

TheSmileyCoder
2,321 Expert Mod 2GB
Assumptions:
I know how to create email from within Access, using outlook automation.
User has the access frontend installed
Office 2003

Is it possible to create a hyperlink in a email that will accomplish the following, when receiver clicks it:?

Open the access front-end on the users PC.
Open relevant form
Goto relevant Item


If its not possible in the way I have described it, I have several modifications that could be acceptable, for example, it would be ok to require that the user has the frontend open when clicking the link. It would also be ok if I had to install a add-on to the users outlook.
Jan 19 '12
54 13159
TheSmileyCoder
2,321 Expert Mod 2GB
@Mariostg: I allready have a installer (basicly another mdb file) that users open to install the main application. This also creates a shortcut on their desktop. (Thats the link part). The application allready has a form called "My Reviews", which shows the reviews assigned to each user, sorted by review status, with buttons to open each review (open form and goto specific item part).
Your suggestion (While appreciated, don't misunderstand me!) adds nothing new really. In short you could say the functionality missing is 1 Email=1 itemLink.

The hyperlink in the email is really just a nice to have feature.

@Adezii1) No not directly. By that I mean that I cannot sit from my own PC and remotely interact with theirs. I can go shove them off their chair and do work at their workstation. I am not IT savvy, my main expertise lies in Access and Railway Safety (odd combo).
That said, each user has their own frontend which gets updated automatically when the user starts an "old" frontend. So if I can add the code to the frontend, You might say that through MSAccess I get access to their PC, and If I can code it in access it can run on their PC with "their" rights.

2)Same as 1)
Jan 26 '12 #51
NeoPa
32,173 Expert Mod 16PB
Smiley:
I just want to tack this onto the thread before I forget it. You can get the MSAccess.exe path from the excel file if you have set a reference to the Access object model, and then use:
Expand|Select|Wrap|Line Numbers
  1. SysCmd(acSysCmdAccessDir)
Excellent. I didn't know about this and I've done various projects (and other questions on here) where this would have proven very useful. I was assuming for a while (before my brain kicked in) that this would be handled by the code at Smiley's end that prepared the command line itself (in cell A1), but then I realised that Smiley's setup may be different from any of his users so it would, indeed, need to be incorporated into the Excel code after all. It's a very worthwhile piece of code though and I was happy to add it to the workbook already provided :-)

NB. In the code below a deliberate choice was made to use late-binding (IE. No Library Reference was made to any version of Access). This is to reduce any likelihood of problems handling potentially various versions on the target PC. It explains the need for the definition of conAccessPath, which is a duplication of acSysCmdAccessDir which would otherwise have been available.
Expand|Select|Wrap|Line Numbers
  1. Option Explicit
  2.  
  3. Private Const conAccessPath As Long = 9
  4.  
  5. Private Sub Workbook_Open()
  6.     Dim strMsg As String, strCmd As String, strAccessPath As String
  7.  
  8.     With CreateObject(Class:="Access.Application")
  9.         strAccessPath = .SysCmd(conAccessPath)
  10.         Call .Quit
  11.     End With
  12.     strCmd = Range("A1")
  13.     strCmd = Replace(strCmd, "%AccessPath%", strAccessPath)
  14.     strCmd = Replace(strCmd, "%ProgramFiles%", Environ("ProgramFiles"))
  15.     strMsg = "You are about to run the command :%L%L%C"
  16.     strMsg = Replace(strMsg, "%L", vbNewLine)
  17.     strMsg = Replace(strMsg, "%C", strCmd)
  18.     If MsgBox(Prompt:=strMsg, _
  19.               Buttons:=vbOKCancel Or vbQuestion, _
  20.               Title:="RunCommand") = vbOK Then _
  21.         Call Shell(PathName:=strCmd, WindowStyle:=vbMaximizedFocus)
  22.     If Application.Workbooks.Count > 1 Then
  23.         Call Me.Close
  24.     Else
  25.         Call Application.Quit
  26.     End If
  27. End Sub
Smiley:
Users must also allow macros, in order for the excel code to run. I think a potential problem with the Excel solution is that we will soon be upgrading to Office 2010, and I fear that I will have to look into a lot of macro security issues at that time.
Indeed. You will find this precondition referred to in post #44.

My own preferred solution to users running my code, without compromising their macro security generally, is to sign all my projects. Information on how this may be done for free can be found at Code Signing.
Attached Files
File Type: zip RunCmd.Zip (19.7 KB, 82 views)
Jan 26 '12 #52
Mariostg
332 100+
@TheSmileyCoder
Expand|Select|Wrap|Line Numbers
  1. Your suggestion (While appreciated, don't misunderstand me!) adds nothing new really
Don't worry. I did not loose any sleep on this. You are spoiling your users. I hope they see and recognize the efforts you are investing :).
Jan 30 '12 #53
NeoPa
32,173 Expert Mod 16PB
Lol Mario :-D

It never hurts to let the users think it's for their benefit, but we all understand it's mainly to stop all the calls back to you when they manage to muck (was that an 'm'?) up even the simplest procedures and break even the most robust systems. The less scope they have for damage the better I sleep :-D

PS. I see one of the big benefits of contributing to a forum site such as this is that we can all pick up from, and use for ourselves, some of the ideas and procedures that get developed to handle questions such as these. I certainly intend to add this one to my arsenal, and I'd never considered this type of problem before.
Jan 30 '12 #54
TheSmileyCoder
2,321 Expert Mod 2GB
I finally figured this out, many years later, and blogged about. You can find the blog post here:
http://thesmileycoder.com/access-ema...ink-to-record/
Jan 30 '17 #55

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

7 posts views Thread by Daven Thrice | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by harlem98 | last post: by
1 post views Thread by Geralt96 | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.