How do I link a contact to an Access database seamlessly?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have an Access table with records for some of my Outlook Contacts. This
stores lots of additional information that I need to store - for an
application I am writing to help my work in a hospital. Using the 6 user
defined fields within Outlook was an option but do not permit use of the
powerful analysis and reporting functionality in Access.

I would like to be able to jump or link directly from my Contact in MS
Outlook to the corresponding Contact in MS Access (NOTE: tables have common
unique primary key: Contact Number).

I think it should be possible. Does it require use of COM+ interface? (I
read about this language in an official MS Access textbook authored by
Viescas)
 
From the tables view you can; File|Get External Data|Link Tables then from
the 'Files of type:' select 'Outlook()' and drill into and select the
desired object.

--
Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

:
|I have an Access table with records for some of my Outlook Contacts. This
| stores lots of additional information that I need to store - for an
| application I am writing to help my work in a hospital. Using the 6 user
| defined fields within Outlook was an option but do not permit use of the
| powerful analysis and reporting functionality in Access.
|
| I would like to be able to jump or link directly from my Contact in MS
| Outlook to the corresponding Contact in MS Access (NOTE: tables have
common
| unique primary key: Contact Number).
|
| I think it should be possible. Does it require use of COM+ interface? (I
| read about this language in an official MS Access textbook authored by
| Viescas)
 
Thanks Dave.
I did consider this but it only works one way, i.e. from Access to Outlook
(in may case Contacts).
I jump from an appointment in Outlook diary to a Contact. *I am then hoping
to jump from there to the corresponding table in my Access database -
possibly linkes as you described.*
-Martin
 
You'll just need to find a unique column or group of columns common to your
access table with which you can create the join (possibly phone number)

In Outlook it appears I can ADD any number of predefined or custom contacts
Categories. I know next to nothing of the Outlook object model. You might
want to ask them in one of the Outlook groups since you may not need Access
or there might be a better way to accomplish your task.

--
Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

:
| Thanks Dave.
| I did consider this but it only works one way, i.e. from Access to Outlook
| (in may case Contacts).
| I jump from an appointment in Outlook diary to a Contact. *I am then
hoping
| to jump from there to the corresponding table in my Access database -
| possibly linkes as you described.*
| -Martin
 
Yes, you can build a button in outlook that uses com+, or what we refer to
as automation.

You need to be quite fluent in VBA to do this kind of stuff.

The code in outlook would look something like:

Dim oAccess As Access.Application

oAccess.OpenCurrentDatabase ("c:\test.mdb")

oAccess.DoCmd.OpenForm "Customer"
oAccess.Forms("Customer").GOTOID = 1234
oAccess.Visible = True

note the "gotoid" would be a custom method of the form 'customer' that you
write. Of course, being the fluent developer you are, you realize that any
public function of a form becomes a "method" of that form. in fact, we would
better to use a custom property.

So, you would define the following two properties of the form

Public Property Let GOTOID(ID As Long)

Me.RecordsetClone.FindFirst "id = " & ID

If Me.RecordsetClone.NoMatch = False Then

Me.Bookmark = Me.RecordsetClone.Bookmark
End If

End Property

Public Property Get GOTOID() As Long

GOTOID = Me!ID

End Property

The above lets you go:

msgbox "the current id of the form is" & forms("mycustomers").GOTOID

And, to move the form to whatever id, you can go

forms("myCusotmers").GOTOID = 123

So, you just add a few extra methods to your form, and then you can use
automation from outlook. Note that my automaton example is VERY bad, since
it uses early binding. Further, my example is bad, since it does NOT pick up
the running copy of ms-access (the code should launch ms-access ONLY
once,(the first time) the automaton code runs...not each time).
 
Back
Top