Hello,
I'm putting this one in the General because the problem could one of many different areas. I'm using a query, one data entry form and a form with List, vba with Microsoft Outlook Object Library code and it is checked in the references.
First, I've created a query that checks for open tasks. I use that query on a blank form with a list box that uses the query to fill it if there are open tasks. And if there are tasks, send an email to the assigned person.
Here's the flow of things.
1. Data Entry form, automatically creates an open task item if any edits have been done.
2. When form is closed, in the unload i open my second form with the list box and use the following code if the task list is populated. Otherwise it does nothing.
I'm working with Windows 7, Office 2010. I've used all of this in other areas before. The email, I've used in Excel to send notices to people. The checking of the list I've used in Access before. I didn't think there would be a problem.
So after I have built all of this, I test it and it works fine. I get an email message in my inbox (since I'm the test guy) and everything seems great. I then close Access. And when I open it, I get a "Microsoft Access Has Stopped Working" prompt. And then I have to close access. I can bypass my startup and it will open and show me the objects in the database. If I try to Edit the Form with the ListBox, I will get the same message.
Any search for this error seems to direct me towards something completely unrelated to my problem. I'm using and developing with up to date software and operating system. I'm using parts of these methods in the database, the new thing to the database is the Outlook Objects, but they do work in my Excel sheet just fine.
Thanks for any help. Hopefully I've given enough detail.
Ed
I'm putting this one in the General because the problem could one of many different areas. I'm using a query, one data entry form and a form with List, vba with Microsoft Outlook Object Library code and it is checked in the references.
First, I've created a query that checks for open tasks. I use that query on a blank form with a list box that uses the query to fill it if there are open tasks. And if there are tasks, send an email to the assigned person.
Here's the flow of things.
1. Data Entry form, automatically creates an open task item if any edits have been done.
2. When form is closed, in the unload i open my second form with the list box and use the following code if the task list is populated. Otherwise it does nothing.
Code:
Me.Visible = False
Dim appOutlook as Outlook.Application, _
mailOutlook as Outlook. MailItem
Set appOutlook = CreateObject("Outlook.Application")
Set mailOutlook = appOutlook.createItem(olMailItem)
With mailOutlook
.BodyFormat = olFormatPlain
.To = "email address"
.Subject = "Automated Message"
.Body = "This is an automated message and you have tasks to complete"
.DeleteAfterSubmit = True
.Send
End With
Set appOutlook = Nothing
Set mailOutlook = Nothing
I'm working with Windows 7, Office 2010. I've used all of this in other areas before. The email, I've used in Excel to send notices to people. The checking of the list I've used in Access before. I didn't think there would be a problem.
So after I have built all of this, I test it and it works fine. I get an email message in my inbox (since I'm the test guy) and everything seems great. I then close Access. And when I open it, I get a "Microsoft Access Has Stopped Working" prompt. And then I have to close access. I can bypass my startup and it will open and show me the objects in the database. If I try to Edit the Form with the ListBox, I will get the same message.
Any search for this error seems to direct me towards something completely unrelated to my problem. I'm using and developing with up to date software and operating system. I'm using parts of these methods in the database, the new thing to the database is the Outlook Objects, but they do work in my Excel sheet just fine.
Thanks for any help. Hopefully I've given enough detail.
Ed