Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ACCESS-Outlook Problem

Status
Not open for further replies.

franksirvent

Programmer
Mar 8, 2002
358
0
0
GB
Hi there

i have a problem which I cannot work out whats wrong

I have an Access application which runs through all the emails in an Outlook directory, which usually only contains within 5-20 emails maximum.
It goes through each email and, if it matches certain parameters, it then saves the Attachment of the email into a C:\temp directory. At the same time the email is deleted from in InTray.

The application runs every 5 minutes...

For some reason, when it is running the code (ever 5 minutes) it locks the PC...cannot click on anything...I have to wait until it has finished running the process, before I can do anything else.

Is anyone aware of this problem and how to fix it? Is it a bug?

I am using the Ontimer event....

thanks in advance
 
franksirvent,

Any chance of seeing the code you are using?

"My God! It's full of stars...
 
Hi there,

I've been doing some testing and found that I have the following problem:

I get error 91 on the following code (which is part of the module which has the problem already mentioned)
I believe this might be causing the problem

Find below part of the code.
I am marking with ***** the line which is causing error number 91:

If anyone can see the problem, I'll appreciate you tell me what I have done wrong. Thanks


Set myOlApp = CreateObject("Outlook.Application")
Set myNamespace = myOlApp.GetNamespace("MAPI")
Set oFolder = myNamespace.GetDefaultFolder(olFolderInbox)
foldername = Forms!MainMenu!the_Inbox_Folder
Set oExtractFolder = oFolder.Folders(foldername)


sqlline = "SELECT NON_KK_Log_Client_Data.Client_KN_Code, NON_KK_Log_Client_Data. NON_KK_Log_Client_Data. FROM NON_KK_Log_Client_Data;"

Set dbsNONKK = CurrentDb()
Set rstNONKK = dbsNONKK.OpenRecordset(sqlline)

If oExtractFolder.Items.Count > 0 Then


For i = oExtractFolder.Items.Count To 1 Step -1

Set oItem = oExtractFolder.Items(i)
strControl = strControl + 1
Set dbs = CurrentDb()
Set rst = dbs.OpenRecordset("Clients Data")

rst.MoveFirst


Do Until rst.EOF

******* If InStr(oItem.Subject, rst!KKLOG_CODE) Then
..........
ELSE
....
END IF

ETC,
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top