Unanswered: Calling Access function or sub from Outlook
Hello, this is my first time being here...
I'm making a simple vb module in Outlook 2007 for recurrence event in Access 2007.
Basically, my db has a sub to update its tables from different db, and I want Outlook's task function to run it everyday at a certain time.
I got this code running, but this opens and brings up the actual db window for a split second, and closes it automatically
Is there anyway to run this in the background so that i won't have to see the window at all??
=========code I found (modified)=========
Dim appAccess As New Access.Application
Dim objDBase As Object
Const strDbPath = "\\Db_Server\DB\DbFile.mdb"
Set objDBase = GetObject(strDbPath)
Set appAccess = objDBase.parent
Set appAccess = Nothing
this opens up the database, but results in error 13 Type Mismatch.
"CheckForUpdate" - SUB name
****n = .r u n
Is there a better way to schedule the sub for automated recurrence in background?
Thank you very much for your attention in advance fellas...
To be honest, I've never tried scheduled running of an Access sub from Outlook before. Typically what I do is to create an mdb file with a form with the necessary code to run On Load, and then use the Task Scheduler to launch the mdb file when needed.
You can use
to turn the screen refresh off for the second you run the code if needed. Just make SURE to turn it back on (docmd.echo true), using Error Handling as needed to make sure it gets back on in the eventuality of an error.
ah, great. I actually found out that calling macros within Outlook Tasks became an another challenge.
that's a much simpler solution. I just made a form and put a call subname in it OnLoad. I'll see how it's gonna work now. Since my db proc is a simple 'fetch the data from other db, calculate/analyze, and update the local table" deal, i'm sure it'll be just fine.