View Single Post
  #2  
Old June 4th, 2010, 08:15 PM posted to microsoft.public.access.forms
Ken Snell
external usenet poster
 
Posts: 177
Default this code doesn't work fully

Open CurrentProject.Path & "\Accounts\Users\" + username + ".txt" For
Output As #1
--

Ken Snell
http://www.accessmvp.com/KDSnell/


"Bob H" wrote in message
...
I am trying to create a login box for an Access 2007 database using some
VB8 code I found:

Private Sub CreateAcc_Click()
Dim username As String
username = Text23
If Text23 = "" Then
MsgBox "Enter a Username !"
Else
If Text25 = "" Then
MsgBox "Enter a Password !"
Else
Open app.Path & "\Accounts\Users\" + username + ".txt" For Output As
#1
Print #1, Text23
Print #1, Text25
Close #1
End If
End If

End Sub

It runs up to the line 'Open app.path etc, then get a runtime error 424,
Object required.
What would that be, and what should the correct syntax be for Open
app.path

Thanks