[AccessD] Dialog Box for Creating .txt tables

Rocky Smolin at Beach Access Software rockysmolin at bchacc.com
Tue Mar 17 17:02:22 CDT 2009


I was just doing this Bud.  I use the code from the Access Developer's
Handbook - just what you want:

        lngFlags = adhOFN_HIDEREADONLY Or _
         adhOFN_HIDEREADONLY Or adhOFN_NOCHANGEDIR
    
        varFileName = adhCommonFileOpenSave( _
            OpenFile:=False, _
            Filter:=strFilter, _
            flags:=lngFlags, _
            DialogTitle:="Enter File Name and Location for Mail List File
Export")
        
            varFileName = adhTrimNull(varFileName)
            
    intReply = MsgBox("Ready To Export Mailing List " & txtMailingList _
        & " to " & varFileName & ". OK to continue", vbYesNo)
    If intReply <> vbYes Then
        MsgBox "Export Aborted.", vbExclamation
        Exit Sub
    Else
        'DoCmd.TransferSpreadsheet acExportDelim, , "qryExportMailingList",
varFileName, True
        DoCmd.TransferSpreadsheet acExportDelim, acSpreadsheetTypeExcel9,
"qryExportMailingList", varFileName, True
        
        MsgBox "Mail List Exported.", vbExclamation
    End If 


Of course, my transfer is failing but the file name ends up in the var just
fine.

Rocky Smolin
Beach Access Software
858-259-4334
www.e-z-mrp.com
www.bchacc.com
 
 

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Bud Goss
Sent: Tuesday, March 17, 2009 2:45 PM
To: Access Group
Subject: [AccessD] Dialog Box for Creating .txt tables

I have an Access application that creates a text (.txt) table using
DoCmd.TransferText.
 
In this application, I would like to display a windows dialog box showing
“Save in;” and “File name:” that would allow the user to navigate to the
directory where the table would be located and designate file name to be
used.
(Similar to the dialog box that you see when you do a file save as in
Microsoft word etc.) 
 
Is it possible to do this in Access?
 
If so, would some one tell me where I can find information and examples. 
--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com





More information about the AccessD mailing list