View Single Post
  #12  
Old June 5th, 2010, 09:16 PM posted to microsoft.public.access.forms
Douglas J. Steele[_3_]
external usenet poster
 
Posts: 3,143
Default this code doesn't work fully

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