http://www.scribd.
com/doc/24070840/Hospital-Management-System-Synopsis-and-Proje
ct-Report
If txtFields(35).Text = datPrimaryRS.Recordset.Fields("Time Of Party") Then
MsgBox "Party already booked!", vbInformation, "Party"
Exit Sub
End If
On Error Resume Next
02 If KeyAscii = 13 Then
03 txtstudentname.SetFocus
04 rs.MoveFirst
05 While rs.EOF = False
06 If Val(txtstudentid.Text) = rs.Fields!StudentID Then
07 MsgBox "RECORD ALREADY EXISTS!", vbOKOnly + vbInformation, "EXCELLENT AC
ADMY"
08 txtstudentid.SetFocus
09 Exit Sub
10 Else
11 If txtstudentid = nul Then
12 MsgBox "Please enter StudentID!", vbOKOnly + vbInformation, "EXCELLENT A
CADMY"
13 txtstudentid.SetFocus
14 Exit Sub
15 End If
16 End If
17 rs.MoveNext
18 Wend
19 End If
If txtstudentid.Text = nul Or txtstudentname.Text = nul Or txtfathername.Text =
nul _
02 Or txtdob.Text = nul Or txtclass.Text = nul Or txtsubjects.Text = nul Or
txtmedium.Text = nul _
03 Or txtfee.Text = nul Or txttotalsubjects.Text = nul Then
04 MsgBox "Please enter the required field(s)!", vbOKOnly + vbInformation,
"EXCELLENT ACADMY"
05 txtstudentid.SetFocus
06 Exit Sub
07 Else
08 rs.AddNew
09
10 rs.Fields!StudentID = txtstudentid
11
12 rs.Fields!StudentName = txtstudentname
13
14 rs.Fields!FatherName = txtfathername
15
16 rs.Fields!DOB = txtdob
17
18 rs.Fields!Class = txtclass
19
20 rs.Fields!subjects = txtsubjects
21
22 rs.Fields!Medium = txtmedium
23
24 rs.Fields!totalfee = txtfee
25
26 rs.Fields!TotalSubjects = txttotalsubjects
27
28 rs.Fields!admissiondate = txtadmissiondate
29
30 txtstudentid.Text = ""
31 txtstudentname.Text = ""
32 txtfathername.Text = ""
33 txtdob.Text = ""
34 txtclass.Text = ""
35 txtsubjects.Text = ""
36 txtmedium.Text = ""
37 txtfee.Text = ""
38 txttotalsubjects.Text = ""
39 rs.Update
40 MsgBox "One record have saved & applied in database!", vbOKOnly + vbInfo
rmation, "EXCELLENT ACADMY"
41 End If
Public con As New ADODB.Connection 'code for login ad reference ms ado2.0 librar
y
Public rs As New ADODB.Recordset
Public rno As Integer
Private Sub LOGIN_Click()
rs.Requery
Dim flag As Integer
flag = 0
Do While Not rs.EOF
If USERNAME.Text = rs.Fields(0) And PASSWORD.Text = rs.Fields(1) Then
flag = 1
rno = rs.AbsolutePosition
If rs.Fields(2) <> "administrator" Then
form2.create.Visible = False
End If
con.Close
form2.Show
FORM1.Hide
Exit Do
Else
rs.MoveNext
End If
Loop
If flag = 0 Then
PASSWORD.Text = ""
invalid.Caption = "INVALID USER NAME OR PASSWORD"
invalid.Visible = True
PASSWORD.SetFocus
End If
End Sub
Private Sub Form_Load()
invalid.Visible = False
Label1.Caption = "user name"
USERNAME.Text = ""
Label2.Caption = "password"
PASSWORD.Text = ""
LOGIN.Caption = "LOGIN"
con.Open ("PROVIDER=SQLOLEDB.1;DATASOURCE=MUZAFAR-A2A9EE7;INTEGRATED SECURITY=SS
PI;INITIAL CATALOG=HRMS")
rs.Open "SELECT * FROM USERID", con, adOpenStatic, adLockOptimistic
End Sub