0% found this document useful (0 votes)
51 views4 pages

Principal'S Diary Source Code Form 1 (Log in Form)

This document contains source code for a login form and diary reminder form. The login form code authenticates the user by comparing the entered username and password to values stored in a database table. If authenticated, it opens a second form and hides the login form. The diary reminder form code queries a database table to retrieve reminder messages for the current date, and displays any messages found on a separate form.

Uploaded by

Jithendra Babu
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
51 views4 pages

Principal'S Diary Source Code Form 1 (Log in Form)

This document contains source code for a login form and diary reminder form. The login form code authenticates the user by comparing the entered username and password to values stored in a database table. If authenticated, it opens a second form and hides the login form. The diary reminder form code queries a database table to retrieve reminder messages for the current date, and displays any messages found on a separate form.

Uploaded by

Jithendra Babu
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

PRINCIPALS DIARY SOURCE CODE FORM 1(LOG IN FORM)

CODE Private Sub Command1_Click() cn.Open GetConnection With rs .CursorLocation = adUseClient

.Open "SELECT pswd,usnm FROM login ", cn, adOpenDynamic, adLockOptimistic

If .EOF = False Then

For i = 0 To .RecordCount - 1

If Text1.Text = !usnm Then If Text2.Text = !pswd Then

Form2.Show Form1.Hide Else MsgBox "Wrong Password.", vbCritical, "Authentication Error" Text2.Text = "" Text2.SetFocus End If Else MsgBox "Incorrect UserName.", vbCritical, "Authentication Error" Text1.Text = "" Text1.SetFocus .MoveNext End If

Next i

End If

.Close: Set rs = Nothing

cn.Close: Set cn = Nothing End With Text3.Text = DateValue(Now) cn.Open GetConnection With rs .CursorLocation = adUseClient

.Open "SELECT * FROM remin WHERE dt='" & Text3.Text & "'", cn, adOpenDynamic, adLockOptimistic For i = 0 To .RecordCount - 1 If .EOF = False Then Text4.Text = !tm + " " + !dt + " " + !re

If Text4.Text <> "" Then

Form12.Show End If End If .MoveNext Next i .Close: Set rs = Nothing

cn.Close: Set cn = Nothing End With

End Sub Private Sub Command2_Click() Form11.Show End Sub Private Sub Data1_Validate(Action As Integer, Save As Integer) End Sub Private Sub Form_Unload(Cancel As Integer)End End Sub

You might also like