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!