troubleshooting Question

Error in saving the Ms Access text file

Avatar of Hankwembo Christopher,FCCA,FZICA,CIA,MAAT,B.A.Sc
Hankwembo Christopher,FCCA,FZICA,CIA,MAAT,B.A.ScFlag for Zambia asked on
Microsoft Access
7 Comments1 Solution13 ViewsLast Modified:
First Many thanks to you all for trying very to assist on how to save string from MS Access to a text file, however, there are still a few things remaining to get it right, the file to save is giving a debug error when trying save. Could it be I'm going off the line again?

Private Sub CmdServings_Click()
Dim strData As String
Dim n As Integer
Dim dlg As filedialog
Dim GetFilePath As Object
    Set dlg = Application.filedialog(msoFileDialogSaveAs)
    dlg.AllowMultiSelect = False
    dlg.Title = "Select the file to be imported..."
   
    If dlg.Show Then
    GetFilePath = dlg.SelectedItems(1)
    End If
n = FreeFile()
Print #n, strData
Close #n
End Sub



ASKER CERTIFIED SOLUTION
Hankwembo Christopher,FCCA,FZICA,CIA,MAAT,B.A.Sc
Managing Partner

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 7 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 7 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros