我在Excel中有一个表单,我想用它来更新SharePoint列表。我发现最简单/合法/可行的方法是将SharePoint列表链接到Access数据库并从Excel更新它。我已经得到它来更新列表,但我可以让Access保留我的回车。我试过vbCrLf,Chr(13)& Chr(10)和/ n(C语法显然不起作用)。我已经尝试按原样编写它们,用“”但是用“”它逐字写入(当然)..我已经尝试将回车符添加到变量中并添加到字符串中以创建字段。我被卡住了!这是我的代码片段:
ProblemStatement = txtProblem.Value & vbCrLf
SolutionStatement = txtSolution.Value & vbCrLf
Set oAcc = CreateObject("Access.Application")
'Open Database in Microsoft Access window
oAcc.OpenCurrentDatabase "C:\Documents and Settings\ecook\MyDocuments\NoneArchived.accdb", True
oAcc.Visible = False
'Create a Recordset based on <Table name>
Set rstTable = oAcc.CurrentDb.OpenRecordset("NoneArchived")
With rstTable
.AddNew
![PrintedPassdown] = ProblemStatement & _
SolutionStatement & _
Maintenance
![ToolSet] = ToolSet
![Tool] = Chamber
.Update
End With
oAcc.Application.Quit
Set oAcc = Nothing
Workbooks(MyWorkbook).Activate
我也遇到Access应用程序未关闭的问题。数据库关闭,但不是应用程序......有趣!我将衷心感谢您的帮助。 CookieCoder