By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,493 Members | 1,186 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,493 IT Pros & Developers. It's quick & easy.

Linking to an access record from an email

P: 31
Hello,

I've developed an access database to track work against team plans and organizational objectives.

I'm trying to implement a feature but I'm not sure where to start. I'm wondering if there is any way of opening a database at a specific record by using a hyperlink in an email.

For example, I want users to be able to receive an email like

"I've assigned this task to you. Please check it out on the database (hyperlink)"

Is there any way of passing arguments to Access in this way?
Any suggestions appreciated.
Dec 18 '08 #1
Share this Question
Share on Google+
3 Replies


puppydogbuddy
Expert 100+
P: 1,923
see this link for code that might help you get started, and give you something that you can adapt and build on.

Access Reading Outlook E-Mails from Access
Dec 18 '08 #2

P: 31
Hi,

Thanks for the reply, Puppydogbuddy.
I'm a little confused as to how to start with this one; am I right that this bit of code actually monitors the inbox?

The database wouldn't always be open, so I wonder if there would be any way of passing arguments from a hyperlink in an email to start the database and then go to a specified record?

I'd rather not tamper with my colleagues' inboxes if possible!
Dec 19 '08 #3

puppydogbuddy
Expert 100+
P: 1,923
OK, here is an example that I found on a public forum. The code is credited to Jim Everist. I do not know HTML, so I leave it to you to modify the HTML to the specifics of your application. As to opening your database to a specific record, you can use the OpenForm of the DoCmd with a where clause argument....
For example (assuming where clause returns a text value), DoCmd.OpenForm "YourForm",,, "[SomeField] = '" & YourVariable & "'"


Expand|Select|Wrap|Line Numbers
  1. 'Set the mail .BodyFormat to HTML (= olFormatHTML) and then use HTML tags inside of the .HTMLBody property like this:
  2.  
  3. Sub SendFileLink()
  4. Dim sSubject As String, sBody As String, sEmail As String
  5.  
  6. sSubject = "Test File Hyperlink Email"
  7. sBody = sBody & "This is the filename link:" & vbCrLf
  8. sBody = sBody & "<A href=""file://server-name/share/folder/folder/folder/file""><FONT face=Verdana size=2>filename</FONT></A>"
  9. sEmail = "emailname@company.com"
  10.  
  11. Dim oApp As New Outlook.Application
  12. Set oApp = New Outlook.Application
  13.  
  14. Dim oMail As Object
  15. Set oMail = oApp.CreateItem(olMailItem)
  16.  
  17. oMail.BodyFormat = olFormatHTML
  18. oMail.HTMLBody = sBody
  19. oMail.Subject = sSubject
  20. oMail.To = sEmail
  21.  
  22. oMail.Send
  23.  
  24. Set oMail = Nothing
  25. Set oApp = Nothing
  26.  
  27. End Sub
Dec 22 '08 #4

Post your reply

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