Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Save As FileDialog Workaround?

Status
Not open for further replies.

FabricMan

Technical User
Dec 29, 2009
7
US
I'm writing a procedure to export a table to a flat data file on disk, but I can't create a FileDialog of type msoSaveAs. Microsoft's website says this feature isn't supported in Access 02. Does anyone have a good workaround for this problem?

Code:
Dim objDialog As FileDialog

'Run-time error 445 here
Set objDialog = Application.FileDialog(msoFileDialogSaveAs)

With objDialog
    .ButtonName = "Save"
    .Title = "Save Claims…"
    .Filters.Clear
    .Filters.Add "Text Files", "*.txt"
    .Filters.Add "All Files", "*.*"
    .InitialFileName = "*.txt"
    
    If .Show = True Then DoCmd.TransferText acExportFixed, , "tblClaims", .Item, False
End With

Set objDialog = Nothing
 
I can't seem to find any of the methods you used in your example. Are there any special libraries I need to include?
 
What seems to be the problem? You need to cut the code from the link (from code start to code end) and paste it into a new module in your Access database. You can then either use TestIt or the example at the beginning to try it. If you have problems, post back with the details of any error messages.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top