greeneyerat
Technical User
Hi,
I have a command button that when clicked I want to be able to send an eamil. Following is the code I have for the "on click" event procedure:
Private Sub email_Click()
Dim myOlApp As Object
Dim myEmail As Outlook.MailItem
Set myOlApp = CreateObject("Outlook.Application")
Set myEmail = myOlApp.CreateItem(olMailItem)
With myEmail
.To = Me.emailAddress
.Subject = "This is an email"
.Body = "Type email here"
End With
myEmail.Display
End Sub
The error stated in the subject line is what is being returned. I have the MS Outlook Object Library already referenced.
Second question: I have created 4 forms, and used several of the same fields from one table. Each form must remain as a stand alone form.
The problem is that when I enter a record on one form, the data also appears on the three other forms created. The forms I am using are to store data regarding written procedure for 4 departments. As a test I tried recreating one of the forms using a query and the form is visible in Design view, but not in form view.
Any help will be greatly appreciated.
Thank you!!!!
I have a command button that when clicked I want to be able to send an eamil. Following is the code I have for the "on click" event procedure:
Private Sub email_Click()
Dim myOlApp As Object
Dim myEmail As Outlook.MailItem
Set myOlApp = CreateObject("Outlook.Application")
Set myEmail = myOlApp.CreateItem(olMailItem)
With myEmail
.To = Me.emailAddress
.Subject = "This is an email"
.Body = "Type email here"
End With
myEmail.Display
End Sub
The error stated in the subject line is what is being returned. I have the MS Outlook Object Library already referenced.
Second question: I have created 4 forms, and used several of the same fields from one table. Each form must remain as a stand alone form.
The problem is that when I enter a record on one form, the data also appears on the three other forms created. The forms I am using are to store data regarding written procedure for 4 departments. As a test I tried recreating one of the forms using a query and the form is visible in Design view, but not in form view.
Any help will be greatly appreciated.
Thank you!!!!