By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,483 Members | 1,506 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,483 IT Pros & Developers. It's quick & easy.

Problems deleteing appointments in Outlook from Access

P: n/a
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
specific date to a specific date not all of the appointments are deleted

When I try this:

For Each objAppointment In myItems
' Testing if objAppointment is in range, if it is, it will
delete it
If DateValue(objAppointment.Start) <= dtmEnd And
DateValue(objAppointment.End) >= dtmStart Then
objAppointment.delete
End If
Next

When trying this method only half of the appointments are deleted

When I try this method:

Set objAppointment = myItems.GetFirst
Do While Not (objAppointment Is Nothing)
If DateValue(objAppointment.Start) <= dtmEnd And
DateValue(objAppointment.End) >= dtmStart Then
objAppointment.delete
End If
Set objAppointment = myItems.FindNext
Loop
This method always stops after myItems.FindNext, weither or not anything
is deleted, objAppointment is always set to nothing after Set
objAppointment = myItems.FindNext

I would like to come up with a better and cleaner method then adding a
while loop and a Boolean to the first one and setting the Boolean to
true when I delete something and running the loop again if I delete
something. While this would get the job done, I am looking for
something cleaner.

Thanks
Jun 9 '07 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.