xlApp.Quit
rs.Close
Set xlApp = Nothing
Set xlBook = Nothing
导出_Exit:
Exit Sub
导出_Err:
MsgBox "数据错误,请检查!"
Resume 导出_Exit
End Sub
??没有?作者: kfzhigen 时间: 2009-12-18 15:47
Public Function GetFolder() As String
'文件及文件夹路径函数
Dim dlgOpen As FileDialog
Dim i As Long, j As Long
Set dlgOpen = Application.FileDialog(msoFileDialogOpen)
With dlgOpen
.AllowMultiSelect = True
.Show
End With
i = dlgOpen.SelectedItems.Count
If i > 0 Then
GetFolder = ""
For j = 2 To i
GetFolder = GetFolder & dlgOpen.SelectedItems(j) & ";"
Next
j = 1
GetFolder = GetFolder & dlgOpen.SelectedItems(j)
Else
GetFolder = CurDir() & "\"
End If
Set dlgOpen = Nothing
End Function作者: kfzhigen 时间: 2009-12-18 15:48
哪里出错,请教!!作者: kfzhigen 时间: 2009-12-19 09:29
再次请教:为什么数据库中主表与子表中的关系主键为什么一定是自动编号啊?为什么主键设为文本就不能导出子窗体???作者: todaynew 时间: 2009-12-19 18:43 本帖最后由 todaynew 于 2009-12-19 18:44 编辑
呵呵,好像是套用我写的一个实例。
不必是自动编号。只需修改以下语句即可:
sql = "select * from 订单明细 where 生产号='" & Me.生产号.Value & "'"
此外在xlApp.Quit语句前可加xlBook.Save,这样可以省掉一个系统应答。作者: a508 时间: 2009-12-19 21:50
sql = "select * from 订单明细 where 生产号=" & Me.生产号