Donald Fisher
2007-08-25 23:23:27 UTC
I have an Access database as a data source and would like to add a
record using the following code:
Dim ol002 As New Microsoft.Office.Interop.Outlook.Application
Dim olns002 As Microsoft.Office.Interop.Outlook.NameSpace
Dim strENTRYID, strSTOREID, strFOLDER, strSECTION
olns002 = ol002.GetNamespace("MAPI")
Dim fldFolder As Microsoft.Office.Interop.Outlook.MAPIFolder
fldFolder = ol002.GetNamespace("MAPI").PickFolder
strENTRYID = fldFolder.EntryID
strSTOREID = fldFolder.StoreID
strSECTION = InputBox("Enter the section name as you would like
it to be displayed in the schedule [ALL CAPS]." & Chr(13) & Chr(13) & _
"Ensure this is the same name for a section already
loaded.", " Enter Section -")
strFOLDER = InputBox("Enter the exact name of the folder on
your public share for this section [ALL CAPS].", " Enter Share Name -")
Me._Outlook_Task_Reporting_Tool_1_0_2003DataSet.tblSections.AddtblSectionsRow(strSECTION,
strFOLDER, strENTRYID, strSTOREID).AcceptChanges()
MsgBox("The following data has been added to 'tblSections':" &
Chr(13) & Chr(13) & "SECTION: " & strSECTION & Chr(13) & Chr(13) &
"SHARE: " & _
strFOLDER & Chr(13) & Chr(13) & "ENTRYID: " & strENTRYID &
Chr(13) & Chr(13) & "STOREID: " & strSTOREID, MsgBoxStyle.OkOnly, " Add
Complete -")
Why doesn't it work? I get no errors but the backend table is not
updated for some reason.
record using the following code:
Dim ol002 As New Microsoft.Office.Interop.Outlook.Application
Dim olns002 As Microsoft.Office.Interop.Outlook.NameSpace
Dim strENTRYID, strSTOREID, strFOLDER, strSECTION
olns002 = ol002.GetNamespace("MAPI")
Dim fldFolder As Microsoft.Office.Interop.Outlook.MAPIFolder
fldFolder = ol002.GetNamespace("MAPI").PickFolder
strENTRYID = fldFolder.EntryID
strSTOREID = fldFolder.StoreID
strSECTION = InputBox("Enter the section name as you would like
it to be displayed in the schedule [ALL CAPS]." & Chr(13) & Chr(13) & _
"Ensure this is the same name for a section already
loaded.", " Enter Section -")
strFOLDER = InputBox("Enter the exact name of the folder on
your public share for this section [ALL CAPS].", " Enter Share Name -")
Me._Outlook_Task_Reporting_Tool_1_0_2003DataSet.tblSections.AddtblSectionsRow(strSECTION,
strFOLDER, strENTRYID, strSTOREID).AcceptChanges()
MsgBox("The following data has been added to 'tblSections':" &
Chr(13) & Chr(13) & "SECTION: " & strSECTION & Chr(13) & Chr(13) &
"SHARE: " & _
strFOLDER & Chr(13) & Chr(13) & "ENTRYID: " & strENTRYID &
Chr(13) & Chr(13) & "STOREID: " & strSTOREID, MsgBoxStyle.OkOnly, " Add
Complete -")
Why doesn't it work? I get no errors but the backend table is not
updated for some reason.