Try
username = Me!Text23 & vbNullString
Have you setup your form to have a control name Text23 which has the user's
name?!
--
Hope this helps,
Daniel Pineault
http://www.cardaconsultants.com/
For Access Tips and Examples:
http://www.devhut.net
Please rate this post using the vote buttons if it was helpful.
"Bob H" wrote:
Thanks for the coding but now I get runtime error 2465 at the line:
username = Me!Text23& vbNullString.
Thanks
On 04/06/2010 20:21, Douglas J. Steele wrote:
There is no App object in Access.
Private Sub CreateAcc_Click()
Dim intFile As Integer
Dim username As String
username = Me!Text23& vbNullString
If Len(username) = 0 Then
MsgBox "Enter a Username !"
Else
If Len(Me!Text25& vbNullString) = 0 Then
MsgBox "Enter a Password !"
Else
intFile = FreeFile()
Open CurrentProject.Path& "\Accounts\Users\"& username& ".txt" For
Output As #intFile
Print #intFile, Me!Text23
Print #intFile, Me!Text25
Close #intFile
End If
End If
End Sub
.