header

 

MyVbaClub.com 

VBA Access Application   

                                                                                        

 
<< Previous    1...   3  4  [5]  6  7  ...8    Next >>

 

Making Sure Username and Password Aren’t Empty

Now here is the code you looking for. Just know that  Me.txtUserID refers to as control box where users enter their username, and Me.txtPW is textbox control for password.

Code:
'check for value in user UserName
If Nz(Me.txtUserID.Value) = "" Then
  MsgBox "You must enter a User ID", vbOKOnly + vbCritical, "No User ID Entered"
  Me.txtUserID.SetFocus
  Exit Sub
End If


'check for value in user pw
If Nz(Me.txtPW.Value) = "" Then
  MsgBox "You must enter your Password", vbOKOnly + vbCritical, "No Password Entered"
  Me.txtPW.SetFocus
  Exit Sub
End If

 

(If you don’t know how to attach this code to ENTER button, please follow these step-by-step tutorial )

 

 

 

Next : Making Sure to check for update

<< Previous    1...   3  4  [5]  6  7  ...8    Next >>