I have a routine that reads in emails from a group mailbox. Essentially it deletes the table, then adds the records and it runs every 5 minutes and displays on a split form. Sometimes
after it runs there are no records visible so the user has to close the form and re-open it to see the records. Most of the time, it refreshes fine.
I must be doing something wrong!
Heres the code
‘ delete current emails
DoCmd.OpenQuery “Delete_From_Mailbox”
For Each objMessage In DDQInbox
With rst
.AddNew
.Fields("Task_Subject") = objMessage.Subject
.Fields("Body") = objMessage.Body
.Fields("Task_From") = objMessage.SenderName
.Fields("Task_Received") = objMessage.ReceivedTime
.Fields("Status") = "Unassigned"
rst.Update
End With
StatusBar ("Working on Mail item dated: " & objMessage.ReceivedTime)
Next
Forms!Supervisor_Queue.Form.Requery
rst.Close
after it runs there are no records visible so the user has to close the form and re-open it to see the records. Most of the time, it refreshes fine.
I must be doing something wrong!
Heres the code
‘ delete current emails
DoCmd.OpenQuery “Delete_From_Mailbox”
For Each objMessage In DDQInbox
With rst
.AddNew
.Fields("Task_Subject") = objMessage.Subject
.Fields("Body") = objMessage.Body
.Fields("Task_From") = objMessage.SenderName
.Fields("Task_Received") = objMessage.ReceivedTime
.Fields("Status") = "Unassigned"
rst.Update
End With
StatusBar ("Working on Mail item dated: " & objMessage.ReceivedTime)
Next
Forms!Supervisor_Queue.Form.Requery
rst.Close