473,549 Members | 2,745 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Appointments from Access 2K to Outlook 2K

I have an Access 2K DB that contains certain fields I want to pull into
an Outlook 2K task.

Here is my code:
--------------------------------------------------------
Function AddOutLookTask( )
Dim appOutLook As Outlook.Applica tion
Dim taskOutLook As Outlook.TaskIte m
Set appOutLook = CreateObject("O utlook.Applicat ion")
Set taskOutLook = appOutLook.Crea teItem(olTaskIt em)
With taskOutLook
..Display
..Subject = "" ' I'd like to have my Client ID field here
..ReminderSet = False
..DueDate = "" ' I'd like to have my Next Contact Date field here
..Save
End With
End Function
--------------------------------------------------------

Here's the question (don't laugh ;)), what do I type so I can pull my
data from the DB? I placed the field names but kept getting this
error: Compile error: Variable not defined. I know I'm missing
somehting simple.

Thank you in advance for your help!

Nov 13 '05 #1
5 2368
Oh, if the form is open, you can refer to the fields like this:

..subject = me.txtSubject

I would put the code into a module outside the form and then pass
strSubject, lngClientID, etc to the function

Function AddOUtlookTask( byval strSubject as string, byval lngClientID
as Long...)

and then I could do this:

..Subject = strSubject
etc

The good thing about this is that your code is MUCH more modular and
you can use it elsewhere (export to another app)
PitchBlackSheep wrote:
I have an Access 2K DB that contains certain fields I want to pull into an Outlook 2K task.

Here is my code:
--------------------------------------------------------
Function AddOutLookTask( )
Dim appOutLook As Outlook.Applica tion
Dim taskOutLook As Outlook.TaskIte m
Set appOutLook = CreateObject("O utlook.Applicat ion")
Set taskOutLook = appOutLook.Crea teItem(olTaskIt em)
With taskOutLook
.Display
.Subject = "" ' I'd like to have my Client ID field here
.ReminderSet = False
.DueDate = "" ' I'd like to have my Next Contact Date field here
.Save
End With
End Function
--------------------------------------------------------

Here's the question (don't laugh ;)), what do I type so I can pull my
data from the DB? I placed the field names but kept getting this
error: Compile error: Variable not defined. I know I'm missing
somehting simple.

Thank you in advance for your help!


Nov 13 '05 #2
Thank you so very much for your quick response!

I will give this a go. Just one more question, do I need to tell
access which database it needs to look at? Would it hurt to place
something like set db = CurrentDb or should I just leave it alone?
Cheers!!!

Nov 13 '05 #3
Here is the code now:

Function AddOutLookTask( ByVal strSubject As String)
Dim appOutLook As Outlook.Applica tion
Dim taskOutLook As Outlook.TaskIte m
Set appOutLook = CreateObject("O utlook.Applicat ion")
Set taskOutLook = appOutLook.Crea teItem(olTaskIt em)
With taskOutLook
..Display
..Subject = strSubject
..ReminderSet = False
..Save
End With
End Function

Get ready to laugh because I must have messed something up. I now get
a macro dialog box asking me to run or create one. What have I done
wrong? Thanks :)

Nov 13 '05 #4
No, you don't. Well, at least if you're just passing data from the
form's controls to Outlook. You don't because you don't need to go
anywhere else in the database hierarchy to get any other information.
(The form is already open, so it and its recordsource are already
available.)

so the function call could be something like this:

' Function AddOUtlookTask( byval strSubject as string, byval lngClientID
as Long...)

AddOutlookTask( "Meeting with Joe", 15, ...)
no need to reference anything else.

Nov 13 '05 #5
Thank you for your help. When I entered in AddOUtlookTask( byval
strSubject as string, byval lngClientID asLong), Access kept asking me
to run a Macro so I changed my code just a bit more:

Option Explicit
Function AddOutLookTask( )
Dim appOutLook As Outlook.Applica tion
Dim taskOutLook As Outlook.TaskIte m
Dim EscrowNo As Long
Dim NextContact As Date
Set appOutLook = CreateObject("O utlook.Applicat ion")
Set taskOutLook = appOutLook.Crea teItem(olTaskIt em)
With taskOutLook
..Display
..Subject = EscrowNo ' The Escrow Numbers are typed in, not
autonumbered
..ReminderSet = False
..DueDate = NextContact ' I have the date in the table as
1/15/05
..Save
End With
End Function

Outlook runs but all I get is a zero in the subject field and 12/1/99
in the date field. My form is open and the current record is active.
I'm ready to give up. Any last suggestions? Thanks :)

Nov 13 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
357
by: Pramod | last post by:
Experts I am also trying to create appointments for Outlook users on a specific Day and time. I was told you can't create appointments for others (but only for the user who is logged on). Is there a way to Create Appointments for everyone i.e. managers, other users through .NET application.
1
1246
by: Mark | last post by:
Hello, Can anyone help me out on how to pull a list of appointments using from Outlook using VB.NET where the appointments show date, time and description? Any help would be greatly appreciated! Thanks in advance.
16
6182
by: Kosmos | last post by:
Good afternoon everyone, just wondering if anyone knew if it's possible to send meetings or appointments through email when you run VBA or SQL code in Access 2003? The following is the code I've been using which sends If you want to see the above code in its full context you can see it here: ...
1
7945
by: keri | last post by:
Hi everyone, After numerous failed attempts at this I am now trying again to solve this problem. I really would appreciate ANY help as I have been stumped with this for weeks and weeks! I have a form (frmappointments) through which I create an appointment item in my outlook calendar, (and save the appointment to tblappointments in my...
1
2423
by: tbb | last post by:
hi I can create outlook apoointments using the outlook object model. But now to my problem, if the user edit/change the appointment in outlook I have inconsistent data because I store the appointment in my datbase too, so how can a make the change on the database, when someone change the outlook appointment. thx
0
1523
by: Stephen B. Burris Jr. | last post by:
In my database I need to keep the offices calendar up to date with the current information that my database is tracking. To do this I am entering events as appointments. Entering them into outlook is not a problem. The problem comes from when I want to mass delete appointments. When I try to mass delete all the appointments from a...
5
3004
by: mattkorguk | last post by:
Hi, Following the introduction of an appointment booking system in Access I've now given myself another issue. As I'm sending lots of appointments out I'm also then getting lots of the same appointments in my calendar as the organiser. My question is: Is there anyway to prevent the organiser entry being logged? I have switched off...
0
1320
by: Ben Grimwade | last post by:
Hi, im developing an Application that integrates with Outlook by creating an appointment in there calender. The code in question is below Dim appt As Outlook.AppointmentItem obj = diary.Items.Find(" = " & Chr(34) & idCheck & Chr(34)) If obj Is Nothing Then 'Now create a new appointment in the user's diary appt =...
2
3040
by: =?Utf-8?B?RU1jQ2FydGh5?= | last post by:
My organization currently has interfaces in place to generate MS Outlook emails from our business applications. I am trying to determine if it is possible and how difficult it might be to interface with MS Ecxhange or Outlook from a business application and add items to a user's calendar, task list, or at a minimum to set a follow up flag in...
0
1716
by: =?Utf-8?B?TWVlbWEgSnVkeQ==?= | last post by:
I have a Verizon Palm Treo 755p and use Outlook 2002 on my new HP Pavilion (Vista 64-bit). When I was syncing on my old XP PC, everything worked fine. On the Vista PC, when I finally got it to sync (using a Bluetooth USB adapter), I ended up with recurring appointments that act wierd when I try to delete, move or edit them. It won't allow...
0
7520
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7450
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7957
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7809
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6043
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5368
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5088
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3481
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
763
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.