“Save as…” dialog box in MSAccess vba: how?

大兔子大兔子 提交于 2019-11-29 13:01:40
Fionnuala

You can set a reference to the Microsoft Office x.x Object Library and use FileDialog.

FileDialog Properties

Sub ShowFileDialog()
    Dim dlgOpen As FileDialog
    Set dlgOpen = Application.FileDialog(msoFileDialogSaveAs)
    With dlgOpen
        .InitialFileName = "Z:\docs\"
        .Show
    End With
End Sub

Also: How do I get a single file name out of a File Dialog object in VBA (for MS Access 2007)?

For an API solution see here : http://access.mvps.org/access/api/api0001.htm

Works well for me. Simply copy and paste in a new module.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!