Save File API

G

Guest

New to VBA...Need help creating a button on a form that allows the user to
set the save path. I figured out how to at least let them browse to the
desired directory, but that won't let them create a new directory if needed.
I went to mvps.org and saw the code that will do this for me, but I can't get
it to work. What do I do with all of that code to accomplish what I want.
Here's a link to the code...http://www.mvps.org/access/api/api0001.htm

Thanks
 
G

Guest

John,
I am using the same code. Here is a sample of how I am using it to allow
users to save a file:

varGetFileName = Me.cboResource & IIf(blnRecurring, "Rec", "NRec") _
& "_ITM-PM YTD " & Me.cboPeriod.Column(1) & Me.txtCurrYear
'Get the File Name To Save
varGetFileName = ahtCommonFileOpenSave(ahofn_overwriteprompt, _
"\\rsltx1-bm01\busmgmt\", "Excel Spreadsheets (*.xls) *.xls", , _
"xls", varGetFileName, "Save Report", , False)

If varGetFileName = "" Then 'User Clicked CANCEL
blnSaveFile = True
Exit Do
End If
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top