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

  • Thread starter Thread starter R Tanner
  • Start date Start date
R

R Tanner

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?
 
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?

This seems to happen on everyone's machine but mine. Of course,
everyone else's computers are much different. I have admin rights and
stuff and they are locked down TIGHT. lol
 
On Wed, 7 Jan 2009 12:18:50 -0800 (PST), R Tanner

Check if such user can create a Notepad file and save it to this same
location. If not, that's your answer.

-Tom.
Microsoft Access MVP

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?

This seems to happen on everyone's machine but mine. Of course,
everyone else's computers are much different. I have admin rights and
stuff and they are locked down TIGHT. lol
 
Back
Top