Database 从Excel中提取数据以访问数据库
目前有一个标准的公司表单,采用Word格式(可以使用不同的技术)并带有字段 如何从该字段将数据提取到Access DB中 我还愿意听取以下建议,即哪种技术更适合我的要求:Database 从Excel中提取数据以访问数据库,database,excel,ms-access,ms-word,Database,Excel,Ms Access,Ms Word,目前有一个标准的公司表单,采用Word格式(可以使用不同的技术)并带有字段 如何从该字段将数据提取到Access DB中 我还愿意听取以下建议,即哪种技术更适合我的要求: 需要将文件发送给客户,并将填写的信息添加到数据库中 能够从数据库中检索信息并在表单中表示 把表格翻译成Excel。使用功能区“外部数据”选项卡下的“收集数据”从客户收集数据。要从Access将数据拉入电子表格,请执行以下操作。对表单使用Excel电子表格。然后在单击时生成一个包含以下事件的命令按钮: '"cmdbtn1" is
把表格翻译成Excel。使用功能区“外部数据”选项卡下的“收集数据”从客户收集数据。要从Access将数据拉入电子表格,请执行以下操作。对表单使用Excel电子表格。然后在单击时生成一个包含以下事件的命令按钮:
'"cmdbtn1" is the name you assign your command button.
Private Sub cmdbtn1_Click()
Dim appExcel As Excel.Application
Dim wbook As Excel.Workbook
Dim wsheet As Excel.Worksheet
Set appExcel = New Excel.Application
appExcel.Visible = True
Set wbook = appExcel.Workbooks.Open("C:\PathToYourDocument\YourSpreadsheet.xlsx")
'"YourSpreadsheet" is the name of the actual sheet in your workbook.
Set wsheet = wbook.Worksheets("YourSpreadsheet")
With wsheet
'The numbers next to ".Cells(" correspond to locations on your spreadsheet. A1=(1, 1), B1=(1,2), A2=(2, 1)
.Cells(10, 1).Value = txtThing1
.Cells(10, 2).Value = txtThing2
'This is how you combine multiple cell in excel into one Access field.
.Cells(10, 3).Value = txtThing3 + " " + txtThing4 + " " + txtThing5 + " " + Thing5
End With
End Sub
到目前为止,您在努力/研究方面取得了哪些进展?非常感谢您,我将尝试一下。