Sending Email on Click event- Focus Problem
I am using a textbox on a form to allow a user to input feedback. Once they click submit, I want the data from the textbox to populate the email. The code posted below does that just fine. The problem is with the "Microsoft Office Outlook" dialog box that advises that an application is trying to send an email. I would expect this box to pop up, but its comming up in the background behind Access. You have to Alt+Tab to get to it, the form is locked until that is done. It doesn't show up on the task bar either. The form is set as a "single form" not as a popup and not modal. This problem goes away if outlook is not open already, but if outlook is already running, the warning message will only run in the background.
Thanks for any assistance
code being used:
Dim oOApp As Object
Dim oOMail As Object
Dim Message As String
Set oOApp = CreateObject("Outlook.Application")
Set oOMail = oOApp.CreateItem(olMailItem)
Me.Refresh
Message = Description.Value
With oOMail
.To = "johndoe@email.com"
.Subject = "Error Report"
.Body = Message
.DeleteAfterSubmit = True
.Send
End With
Set oOApp = Nothing
Set oOMail = Nothing
[1236 byte] By [
dooey] at [2007-11-11 10:03:23]

# 2 Re: Sending Email on Click event- Focus Problem
no can do, its for use in a corporate environment, wouldn't be able to use a solution like that. Thanks though
dooey at 2007-11-11 17:24:17 >

# 3 Re: Sending Email on Click event- Focus Problem
If there is the possibility that Outlook may already be open you may want to try using GetObject first, and if it fails then use CreateObject. You can find an example at the following link:
http://www.serverwatch.com/tutorials/article.php/1474711