Login System

domingsun

Registered User.
Local time
Today, 12:30
Joined
Jun 20, 2013
Messages
46
Hi All ,

I want create a login system using a TEXT BOX only,

some thing like this :

there is only have 1 text box named USER .
after type in "ADMIN" , i want automatic login without clicking any button or press enter to login . the words "ADMIN" must lookup from my tbluser , if the USER not available in my table then access denied.

anyone have the solution ?
 
If the User Name is going to be always 5 characters then try the following example on a new form, you will get the idea:

  1. Open a New Form in Design View.
  2. Insert a Textbox in the Detail Section.
  3. Display the Property Sheet (F4).
  4. Add >LLLLL;;_ into the Input Mask Property.
  5. Change the Autotab Property value to Yes.
  6. Enter the following VBA Code into the After Update Event Procedure:

    Code:
    Private Sub Text0_AfterUpdate()
    Dim txt
    
    txt = Me![Text0] 'change if the textbox name is not Text0
    'Modify the Dlookup() function contents to point it to your User data table.
    If txt = DLookup("Data", "tblList", "Data = '" & txt & "'") Then
         MsgBox "User Found"
    Else
         MsgBox "Not Found"
    End If
    
    End Sub
  7. Save the Form and try it out.
 

Users who are viewing this thread

Back
Top Bottom