Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2015
    Location
    Wales. Land of the sheep.
    Posts
    1,228

    VBA to check if meeting exists.

    This is using data from an access databasse in an excell table. I'm asking here because I have the most faith in this forum

    This code here checks if a "site" exists already before uploading new apointments. The problem now is, If we have been there in previous months it wont put it in again with the new date. The site name is in column A and the date of the work to be done there is in G.

    Can this code be apapted to check that both of these are the same, then ignore the ones that have a matching site name AND date?

    It's quite urgent i find a solution to this as I'm dealing with a lot of data and need to make sure its correct.

    Code:
    Private Function CheckAppointment(ByVal argCheckData As Variant) As Boolean
       Dim oApptItem        As Object                     'Outlook.AppointmentItem
       Dim oFolder          As Object                     'Outlook.MAPIFolder
       Dim oItem            As Object
       'On Error Resume Next
       Set oFolder = oNS.GetDefaultFolder(&H9)            'olFolderCalendar
       Application.StatusBar = "Checking " & argCheckData
       CheckAppointment = False
       For Each oItem In oFolder.Items
          If oItem.Class = &H1A Then                      ' 26 - olAppointment
             If oItem.Subject = argCheckData Then
                CheckAppointment = True
                Exit For
             End If
          End If
       Next oItem
       Set oApptItem = Nothing
       Set oFolder = Nothing
       Set oItem = Nothing
    End Function
    any help appreciated.

  2. #2
    Join Date
    Jun 2015
    Location
    Wales. Land of the sheep.
    Posts
    1,228
    would anyone know how to check if the date is the same?

Please reply to this thread with any new information or opinions.

Similar Threads

  1. VBA To Check If Query Exists If Does Rename
    By jo15765 in forum Macros
    Replies: 3
    Last Post: 07-28-2014, 02:25 PM
  2. Check to see if record already exists
    By zipaway in forum Programming
    Replies: 4
    Last Post: 06-05-2014, 09:16 AM
  3. Replies: 1
    Last Post: 03-21-2013, 02:14 PM
  4. Check if record exists, Check Number
    By burrina in forum Forms
    Replies: 9
    Last Post: 01-06-2013, 03:49 PM
  5. How to check if Table already exists
    By riaarora in forum Access
    Replies: 1
    Last Post: 08-12-2012, 09:48 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums