Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Software > Access External data > Allow for user ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 2 Topic 10863 of 11313
Post > Topic >>

Allow for user pressing cancel in File/Save API

by =?Utf-8?B?UGhpbCBUcnVtcHk=?= <PhilTrumpy@[EMAIL PROTECTED] Jul 31, 2008 at 09:32 AM

I am using Access 2003 on Windows XP.

I am currently using the Windows File Open/Save Dialog box API to let a
user 
select where to save an excel file.  It works great, but I would like to 
inlcude code to allow for a user to cancel the save and return to the form

without anything happening.   I have tried a couple different things but 
can't get the desired actions to take place.  I copied the code from
mvps.org 
for the API and am using the following code in the application.

Private Sub cmdEx****t_Click()
    Dim strSaveFilename As String
    Dim strRptName As String
    Dim strFilter As String
       
    strQryName = "qryDynamicExcess"
        
    'Ask for SaveFileName
    strFilter = ahtAddFilterItem(strFilter, "Excel Files (*.xls)",
"*.xls")
    strSaveFilename = ahtCommonFileOpenSave( _
                                    OpenFile:=False, _
                                    Filter:=strFilter, _
                    Flags:=ahtOFN_OVERWRITEPROMPT Or ahtOFN_READONLY)
    
    strOutputFilename = strSaveFilename
    DoCmd.OpenForm "frmPleaseWait"
    DoCmd.TransferSpreadsheet acEx****t, , strQryName, strOutputFilename,
True
    
    Call FormatExcel
    'If Right(strRptOutputLocation, 1) <> "\" Then
    '   strRptOutputLocation = strRptOutputLocation + "\"
    'End If
    
    DoCmd.Close acForm, "frmPleaseWait"

Where would I put the code to allow for a cancel?

Thanks in advance for your help.
 




 2 Posts in Topic:
Allow for user pressing cancel in File/Save API
=?Utf-8?B?UGhpbCBUcnVtcHk  2008-07-31 09:32:02 
RE: Allow for user pressing cancel in File/Save API
=?Utf-8?B?UGhpbCBUcnVtcHk  2008-07-31 09:41:06 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Wed Dec 3 19:18:56 CST 2008.