View Single Post
  #9  
Old June 5th, 2010, 04:27 PM posted to microsoft.public.access.forms
Bob H[_4_]
external usenet poster
 
Posts: 161
Default this code doesn't work fully

On 04/06/2010 23:23, Bob H wrote:
On 04/06/2010 20:50, Daniel Pineault wrote:
To pull the path of your currently open database you'd use:

Application.CurrentProject.Path


Ok thanks, but where does this line fit in with the other lines.
Do I have to actually create the path first then put it in the line.

Thanks


Update:
I have used this line to create a text file with given information:

Open "C:\Accounts\Users\" + username + ".txt" For Output As #1
Print #1, Text23
Print #1, Text25

But now on another cmd button I want access to read that said
information in that text file, and grant access.
With this line:

Open "C:\Accounts\Users\" + username + ".txt" For Output As #2
Input #2, openfile
If username.Text = openfile Then
Input #2, datafile

Access throws up a runtime error 54 'Bad File mode' at Input #2 ,
openfile openfile

Also the information in the previously created text file has been deleted.

Thanks