Why Do I get Path/File Access Error On User's Computers When I Try To Create a Text File?

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



I am trying to run the following code to create a text file when the
user selects a button.

Public Sub CreateCredentials()
Dim FileNum As Integer, MyFile As String
FileNum = FreeFile
MyFile = "C:\Documents and Settings\Default User\Application Data
\Identities\Credentials.LOG"

Open MyFile For Append As #FileNum

Print #FileNum, "UserName: " & Forms![frmMain]![User]
Print #FileNum, "Password: " & Forms![frmMain]![PWord]

Close #FileNum

End Sub

I get a Path/File Access error on some machines when I try to run
this. Any ideas why?
.


Quantcast