Hi,
I'm having difficulties trying to understand how to export to Access 2000 from Outlook 2000 from a custom form. I'm very new to Outlook struggling to work out what I need to do in VBScript. I have been looking around on the net and have come up with the following which of course doesn’t work - :
Dim dbe
Dim dbs
Dim wks
Dim rst
Dim strNameAndPath
Dim strDBName
Sub cmdTemp_Click()
Set dbe = Item.Application.CreateObject "DAO.DBEngine.36")
strNameAndPath = "H:\Mydata\MI Request Database\SOURCEDATA\MI_SOURCEDATA.mdb"
MsgBox "DBName " & strDBNameAndPath
Set wks = dbe.Workspaces(0)
Set dbs = wks.OpenDatabase(strDBNameAndPath)
Set rst = dbs.OpenRecordset("tblMainData")
rst.AddNew
rst.CustomerName.Value = Item.CustomerName
rst.Update
rst.Close
dbs.Close
End Sub
I'm probably so far off the mark here, can anyone tell me what I need to do to the code to get it working?
I have published the form and other macros are working!
Thanks in advance.
Nic
I'm having difficulties trying to understand how to export to Access 2000 from Outlook 2000 from a custom form. I'm very new to Outlook struggling to work out what I need to do in VBScript. I have been looking around on the net and have come up with the following which of course doesn’t work - :
Dim dbe
Dim dbs
Dim wks
Dim rst
Dim strNameAndPath
Dim strDBName
Sub cmdTemp_Click()
Set dbe = Item.Application.CreateObject "DAO.DBEngine.36")
strNameAndPath = "H:\Mydata\MI Request Database\SOURCEDATA\MI_SOURCEDATA.mdb"
MsgBox "DBName " & strDBNameAndPath
Set wks = dbe.Workspaces(0)
Set dbs = wks.OpenDatabase(strDBNameAndPath)
Set rst = dbs.OpenRecordset("tblMainData")
rst.AddNew
rst.CustomerName.Value = Item.CustomerName
rst.Update
rst.Close
dbs.Close
End Sub
I'm probably so far off the mark here, can anyone tell me what I need to do to the code to get it working?
I have published the form and other macros are working!
Thanks in advance.
Nic