I am a relatively new Access user in need of some assistance. I have created a module that I need to implement in a DAP. This module emails a notice to me when a command button is clicked. The problem that I am having is that the current code for the command button is in javascript and the module is written in VB. Is there a way to convert to javascript from VB or can I just use the module in the page. I have also created a macro that uses the runcode command, but I couldn't figure out how to use that either. I tried the DoCmd.RunMacro.Email (where email is the user defined macro) but I couldn't get that to work. Here is the code for the module:
Option Compare Database
Dim olApp As Object
Dim subject As String
Dim olMailItem
Dim newMail
Dim newRecipient
Dim mailBody As String
Function SendEMail(void)
subject = "Technical Issue Page"
mailBody = "A new record has been added to the database."
Set olApp = CreateObject("Outlook.Application"
Set newMail = olApp.CreateItem(olMailItem)
Set newRecipient = newMail.Recipients.Add("me@mydomain.com"
With newMail
.subject = subject
.body = mailBody
End With
newMail.send
Set olApp = CreateObject("Outlook.Application"
Set newMail = olApp.CreateItem(olMailItem)
Set newRecipient = newMail.Recipients.Add("me@mydomain.com"
With newMail
.subject = subject
.body = mailBody
End With
newMail.send
olApp.Quit
Set olApp = Nothing
Set newMail = Nothing
Set newRecipient = Nothing
End Function
Public Sub Main()
SendEMail (void)
End Sub
Any help would be appreciated.
Thanks,
Jamie
Option Compare Database
Dim olApp As Object
Dim subject As String
Dim olMailItem
Dim newMail
Dim newRecipient
Dim mailBody As String
Function SendEMail(void)
subject = "Technical Issue Page"
mailBody = "A new record has been added to the database."
Set olApp = CreateObject("Outlook.Application"
Set newMail = olApp.CreateItem(olMailItem)
Set newRecipient = newMail.Recipients.Add("me@mydomain.com"
With newMail
.subject = subject
.body = mailBody
End With
newMail.send
Set olApp = CreateObject("Outlook.Application"
Set newMail = olApp.CreateItem(olMailItem)
Set newRecipient = newMail.Recipients.Add("me@mydomain.com"
With newMail
.subject = subject
.body = mailBody
End With
newMail.send
olApp.Quit
Set olApp = Nothing
Set newMail = Nothing
Set newRecipient = Nothing
End Function
Public Sub Main()
SendEMail (void)
End Sub
Any help would be appreciated.
Thanks,
Jamie