Results 1 to 4 of 4
  1. #1
    caper is offline Novice
    Windows 10 Access 2016
    Join Date
    Aug 2020
    Posts
    8

    MS Access sending the Database or Form via emailed hyperlink

    Morning everyone, a few years ago, I used a MS Access database that autoemailed when a record was created, and then that user who was emailed could click a hyper link that states "NEW RECORD MADE, CLICK TO OPEN", and this took it straight to the MS Access Database Switchboard. Later on, that link was modified to open that form with that particular record in Edit Mode. My question to you guys is I need some assistance on how to add the hyperlink to the MS Access Database to the email generator I made. I cannot seem to get it to recognize either the actual ".laccdb" or the .MAF shortcut to the form. As a plus, if someone knows how to make an advanced hyperlink to put to the actual form and then record automatically,id love to hear your thoughts. If over my novice head, the basic hyperlink to the database or switchboard works perfect

    from what i've been researching, it looks like the code i need is something along the lines of the attached image but it doesnt form a hyperlink

    Here is what I am doing for the auto emailer

    database location:V:\NCRDatabase.laccdb


    MAF Location: V:\SwitchboardNCR.maf

    The Form creates a "visual" email with To, Subject and Body. This will be hidden. For this purpose, the Body shown is thru expression builder:
    ="NCR " & [NCR NUMBER] & Chr(13) & Chr(10) & "Job Number " & [txtjobnumber] & Chr(13) & Chr(10) & Chr(13) & Chr(10) & Chr(13) & Chr(10) & "Problem Source: " & [Problem_Source] & Chr(13) & Chr(10) & "Description of Problem: " & [Description of Problem] & Chr(13) & Chr(10) & Chr(13) & Chr(10) & "Disposition: " & [Disposition]

    Once the record is made, user clicks "SAVE AND EMAIL" button that activates this VBA which calls back to the "visual" email:
    Dim oApp As New Outlook.Application
    Dim oEmail As Outlook.MailItem

    Set oEmail = oApp.CreateItem(olMailItem)
    oEmail.To = Me.txtTo2
    oEmail.Subject = Me.txtSubject2
    oEmail.Body = Me.txtBody2

    If Len(Me.txtAttachment) > 0 Then
    oEmail.Attachments.Add Me.txtAttachment.Value
    End If
    With oEmail
    If Not IsNull(.To) And Not IsNull(.Subject) And Not IsNull(.Body) Then
    .Send
    MsgBox "Email Sent!"
    Else
    MsgBox "Please Fill out the required fields."
    End If
    End With

    Questions:
    1.) Can the hyperlink to the server file location be placed in the expression builder code? or do I need to amend the VBA click to says oemail.Body=Me.TxtBody2 then add the hyperlink code?


    thank you!
    Attached Thumbnails Attached Thumbnails Capture2.PNG   Capture1.PNG  

  2. #2
    Micron is offline Very Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,425
    I have not done this so can't say for sure if this will fix your issue, but your issue is due to the quotes. When an entire string needs to be quoted (as yours does) the inner quotes cannot be " also, otherwise you end up with 2 quoted portions. If you do this, you must concatenate. Otherwise, "use 'single quotes' within the doubles". In case you missed it, that was an example.
    Also, I would not use a drive letter because all users don't always have their native drive volume the same. Better to use an UNC path.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #3
    caper is offline Novice
    Windows 10 Access 2016
    Join Date
    Aug 2020
    Posts
    8
    micron, that did it....thanks! it doesnt allow me to change the hyperlink text but thats fine.

    oEmail.Body = Me.txtBody2 & Chr(10) & Chr(13) & "<\\fileserver\engineering\NCR1.accdb>"

  4. #4
    Micron is offline Very Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,425
    Glad I could help but my comment pertained to your code image so your solution is a bit fuzzy to me. You might get away with vbNewLine instead of chr but I don't recall if it's compatible.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Sending email from the Access Form
    By stalk in forum Programming
    Replies: 1
    Last Post: 05-15-2017, 12:59 PM
  2. Multiple individual reports emailed
    By knightangel in forum Reports
    Replies: 2
    Last Post: 05-13-2014, 05:44 AM
  3. Replies: 8
    Last Post: 04-05-2012, 03:09 PM
  4. Replies: 3
    Last Post: 03-19-2012, 06:10 PM
  5. Automate sending SMS form MS Access
    By Johan in forum Programming
    Replies: 8
    Last Post: 04-15-2010, 12:51 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums