Just for the sake of completeness, Daniel's reply is correct. Somehow the
required spaces didn't appear in the post.
username = Me!Text23 & vbNullString
If Len(username) = 0 Then
MsgBox "Enter a Username !"
Else
If Len(Me!Text25 & vbNullString) = 0 Then
--
Doug Steele, Microsoft Access MVP
http://www.AccessMVP.com/DJSteele/AccessIndex.html
Co-author: "Access 2010 Solutions", published by Wiley
(no private e-mails, please)
"Bob H" wrote in message
...
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