Function DAORU()
Dim strFilename As String
Dim i As Byte
DoCmd.SetWarnings False
DoCmd.OpenQuery "删除表1数据 查询", acViewNormal, acEdit
For i = 1 To 2
strFilename = Choose(i, "E:\数据\背景.xls", "E:\数据\音乐.xls")
DoCmd.TransferSpreadsheet acImport, 8, "表1", strFilename, True, "Sheet1!A1:C100"
CurrentDb.Execute "update 表1 set 表名='" & strFilename & "' where isnull(表名)"
Next
End Function
Function DAORU()
Dim strFilename As String
Dim i As Byte
DoCmd.SetWarnings False
DoCmd.OpenQuery "删除表1数据 查询", acViewNormal, acEdit
For i = 1 To 2
strFilename = Choose(i, "背景", "音乐")
DoCmd.TransferSpreadsheet acImport, 8, "表1", "E:\数据\" & strFilename & ".xls", True, "Sheet1!A1:C100"
CurrentDb.Execute "update 表1 set 表名='" & strFilename & "' where isnull(表名)"
Next
End Function
问题解决,感谢叶海峰老师的多次帮助!谢谢!
总记录:6篇 页次:1/1 9 1 :