目前有一种标准的公司表格,目前采用Word格式(可以使用不同的技术)和字段。
如何从这些字段中将数据提取到Access数据库中?。
我也愿意接受哪些技术能够更好地满足我的要求的建议:
答案 0 :(得分:0)
将该表单翻译成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