HI,
This thread has helped me out a great deal. I was't even sure where to start on emailing from Access. I wouldn't have made it this far without it!
My question/problem is: I have two Forms/Tables that are linked. I have my data in one and the email address (an other data) in another. The problem is that when I click on the button to send the email I get an error that it cannot find the other form.
Weird thing is that if I have that form open and point to email address I want to send to and click the email button it will send it out.
The line that has the problem (That Microsoft Visual Basic highlights in yellow) Email = Forms!Library.Library_Email
Here is the code:
Private Sub Email_Requests_Click()
Dim strEmail, strBody As String
Dim objOutlook As Outlook.Application
Dim objEmail As Outlook.MailItem
'**creates an instance of Outlook
Set objOutlook = CreateObject("Outlook.application"

Set objEmail = objOutlook.CreateItem(olMailItem)
'**************************************************************
'*create string with email address
Email =
Forms!Library.Library_Email
strBody = txtTDate & Chr(13) & Chr(13)
strBody = strBody & "LB: PINC 209" & Chr(13) & Chr(13)
strBody = strBody & "SL: " & Forms!Requests.SL & Chr(13) & Chr(13)
strBody = strBody & "AU: " & Forms!Requests.AU & Chr(13) & Chr(13)
strBody = strBody & "TI: " & Forms!Requests.TI & Chr(13) & Chr(13) & Chr(13) & Chr(13)
'***creates and sends email
With objEmail
.To = Email
.Subject = "ILL Request"
.Body = strBody
.Send
End With
'Set objEmail = Nothing
'****closes Outlook. remove if you do not want to close Outlook
'objOutlook.Quit
'Exit Sub
End Sub
Any help would be greatly apreciated!
mkacz