?
Solved

Pass Varibale from Access to Outlook

Posted on 2009-04-24
1
Medium Priority
?
254 Views
Last Modified: 2013-11-27
Hi, I'm opening an Access Database from Outlook (CreateObject("Access.Application").
When the Access app opens, it runs some VBA code.  In the VBA code are some variables that get set.  I would like to pass these back to Outlook.

So something like.
dim LocalVariable as String
LocalVariable = AccApp.AccessVariable

?
0
Comment
Question by:NO_CARRIER
1 Comment
 
LVL 5

Accepted Solution

by:
ducky801 earned 150 total points
ID: 24226819

Have you considered having your access code write your varible value to a table which can then be read by your outlook code?  

Alternatively, you could create an access object in your outlook routine and reproduce your access code there (run the access stuff from outlook).  
In order to do this you'll have to add a reference.. In outlook VBA editor : Tools>References | Microsoft Accss XX.0 Object Library
Then your code would look something like this:

Sub DoStuffInAccessFromOL()
Dim objAccess As New Access.Application
objAccess.OpenAccessProject "C:\mydb.mdb", False

'use the objaccess object to manipulate access here
 

End Sub

 
 If you'd like to post your existing outlook code, i can take a look for you.
 
Hope this helps
 
AR
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you’re using QODBC to update QuickBooks data from Microsoft® Access but Access is not showing the updated data, you could have set up QODBC incorrectly.
In a use case, a user needs to close an opened report by simply pressing the Escape (Esc) key. This can be done by adding macro code in Report_KeyPress or Report_KeyDown event.
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Suggested Courses

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question