Coding: Menu Form
Coding: Menu Form
Menu Form
End Sub
End Sub
End Sub
‘General Section
Dim db As Connection
Dim rs As Recordset
Dim X As Integer
End Sub
PATIENT INFORMATION
‘Genral
Dim db As Connection
Dim rs As Recordset, rs1 As Recordset
Dim X As Integer
ADD BUTTON
Private Sub Command1_Click()
X=1
If X = 1 Then
End If
End Sub
UPDATE BUTTON
Private Sub Command2_Click()
If X = 1 Then
rs!p_code = Text1.Text
rs!p_f_name = Text2.Text
rs!p_l_name = Text3.Text
rs!d_o_birth = Val(Text4.Text)
rs!c_o = Text5.Text
If Option1.Value = True Then
rs!sex = "M"
Else
rs!sex = "F"
End If
rs!r_name = Text7.Text
rs!addr = Text8.Text
rs!c_code = Text9.Text
rs.Update
Else
MsgBox "first add record and then update"
End If
X=0
End Sub
DELETE BUTTON
Private Sub Command3_Click()
rs.Delete
Text1.Text = " "
Text2.Text = " "
Text3.Text = " "
Text4.Text = " "
Text5.Text = " "
Option1.Value = False
Option2.Value = False
Text7.Text = " "
Text8.Text = " "
Text9.Text = " "
Set rs = New ADODB.Recordset
rs.Open "select
p_code,p_f_name,p_l_name,d_o_birth,sex,c_o,r_name,addr,c_code from
patient_info", db, adOpenStatic, adLockOptimistic
End Sub
EDIT/SAVE BUTTON
Private Sub Command4_Click()
rs!p_code = Text1.Text
rs!p_f_name = Text2.Text
rs!p_l_name = Text3.Text
rs!d_o_birth = Val(Text4.Text)
rs!c_o = Text5.Text
If Option1.Value = True Then
rs!sex = "M"
Else
rs!sex = "F"
End If
rs!r_name = Text7.Text
rs!addr = Text8.Text
rs!c_code = Text9.Text
rs.Update
End Sub
PREVIOUS BITTON
Private Sub Command5_Click()
End If
End If
End Sub
NEXT BUTTON
Private Sub Command6_Click()
On Error Resume Next
If rs.RecordCount >= 1 Then
rs.MoveNext
disp
If rs.EOF = True Then
rs.MoveLast
End If
End If
End Sub
FIRST BUTTON
Private Sub Command7_Click()
On Error Resume Next
rs.MoveFirst
disp
End Sub
LAST BUTTON
Private Sub Command8_Click()
On Error Resume Next
rs.MoveLast
disp
End Sub
EXIT BUTTON
Private Sub Command9_Click()
Unload Me
End Sub
End Sub
DISPLAY FUNCATION
Sub disp()
If rs.RecordCount >= 1 Then
Text1.Text = rs!p_code
Text2.Text = rs!p_f_name
Text3.Text = rs!p_l_name
Text4.Text = rs!d_o_birth
Text5.Text = rs!c_o
If rs!sex = "M" Or rs!sex = "m" Then
Option1.Value = True
Else
Option2.Value = True
End If
Text7.Text = rs!r_name
Text8.Text = rs!addr
Text9.Text = rs!c_code
End If
End Sub
PATIENT RECORD
Dim db As Connection
Dim rs As Recordset, rs1 As Recordset
Dim X As Integer
rs.Update
Else
MsgBox "first add record and then update"
End If
X=0
End Sub
rs!p_code = Val(Text1.Text)
rs!admit_date = Text2.Text
rs!day_no = Val(Text3.Text)
rs!fees = Val(Text4.Text)
rs!ser_code = Val(Text5.Text)
rs.Update
End Sub
End Sub
End Sub
PATIENT REPORT
Dim db As Connection
Dim rs As Recordset, rs1 As Recordset
Dim X As Integer
Else
MsgBox "first add record and then update"
End If
X=0
End Sub
rs!remark = Text6.Text
rs.Update
End Sub
disp
If rs.EOF = True Then
rs.MoveLast
End If
End If
End Sub
Sub disp()
If rs.RecordCount >= 1 Then
Text1.Text = rs!admit_no
Text2.Text = rs!disch_date
Text3.Text = rs!complaints
Text4.Text = rs!tretment
Text5.Text = rs!condition
Text6.Text = rs!remark
End If
End Sub
PATIENT DISCHARGE
Dim db As Connection
Dim rs As Recordset, rs1 As Recordset
Dim X As Integer
End If
End Sub
End Sub
End Sub
End If
End If
End Sub
disp
If rs.EOF = True Then
rs.MoveLast
End If
End If
End Sub
Private Sub Command7_Click()
On Error Resume Next
rs.MoveFirst
disp
End Sub
End Sub
End Sub
End Sub
Sub disp()
If rs.RecordCount >= 1 Then
Text1.Text = rs!bill_no
Text2.Text = rs!sv_code
Text3.Text = rs!no_o_days
Text4.Text = rs!charge
Text5.Text = rs!rec_no
End If
End Sub
PATIENT DATE
Dim db As Connection
Dim rs As Recordset, rs1 As Recordset
Dim X As Integer
End If
End Sub
End Sub
End Sub
End Sub
End If
End If
End Sub
disp
If rs.EOF = True Then
rs.MoveLast
End If
End If
End Sub
End Sub
End Sub
End Sub
Dim db As Connection
Dim rs As Recordset, rs1 As Recordset
Dim X As Integer
Dim sum As Integer, sum1 As Integer
rs.Update
Else
MsgBox "first add record and then update"
End If
End Sub
rs!discount = Val(Text6.Text)
rs!net_amt = Val(Text7.Text)
rs.Update
End Sub
End Sub
End If
End If
End Sub
disp
If rs.EOF = True Then
rs.MoveLast
End If
End If
End Sub
End Sub
End Sub
Private Sub Command9_Click()
Unload Me
End Sub
End Sub
Sub disp()
If rs.RecordCount >= 1 Then
Text1.Text = rs!bill_no
Text2.Text = rs!admit_code
Text3.Text = rs!disch_date
Text4.Text = rs!total
Text5.Text = rs!adv
Text6.Text = rs!discount
Text7.Text = rs!net_amt
End If
End Sub
Private Sub Text7_GotFocus()
End Sub
CITY
Dim db As Connection
Dim rs As Recordset, rs1 As Recordset
Dim X As Integer
End Sub
Else
MsgBox "first add record and then update"
End If
X=0
End Sub
rs.Update
End Sub
End Sub
End If
End If
End Sub
disp
If rs.EOF = True Then
rs.MoveLast
End If
End If
End Sub
End Sub
Private Sub Command8_Click()
On Error Resume Next
rs.MoveLast
disp
End Sub
End Sub
End Sub
Sub disp()
If rs.RecordCount >= 1 Then
Text1.Text = rs!c_code
Text2.Text = rs!c_name
End If
End Sub
DOCTOR INFORMATION
Dim db As Connection
Dim rs As Recordset, rs1 As Recordset
Dim X As Integer
End If
End Sub
rs!phone = Text6.Text
rs!mobile = Text7.Text
rs!addr1 = Text8.Text
rs!addr2 = Text9.Text
rs!c_code = Text10.Text
rs!s_code = Text11.Text
rs!degree = Text12.Text
rs!fees = Text13.Text
rs!next_a_date = Text14.Text
rs.Update
Else
MsgBox "first add record and then update"
End If
X=0
End Sub
rs!phone = Text6.Text
rs!mobile = Text7.Text
rs!addr1 = Text8.Text
rs!addr2 = Text9.Text
rs!c_code = Text10.Text
rs!s_code = Text11.Text
rs!degree = Text12.Text
rs!fees = Text13.Text
rs!next_a_date = Text14.Text
rs.Update
End Sub
End Sub
End If
End If
End Sub
disp
If rs.EOF = True Then
rs.MoveLast
End If
End If
End Sub
End Sub
End Sub
End Sub
Sub disp()
If rs.RecordCount >= 1 Then
Text1.Text = rs!d_code
Text2.Text = rs!d_f_name
Text3.Text = rs!d_l_name
Text4.Text = rs!d_o_birth
End If
End Sub
LOGIN MASTER
Dim db As Connection
Dim rs As Recordset
Dim X As Integer
End If
End Sub
rs.Update
Else
MsgBox "first add record and then update"
End If
X=0
End Sub
End Sub
End Sub
End If
End If
End Sub
Private Sub Command6_Click()
On Error Resume Next
If rs.RecordCount >= 1 Then
rs.MoveNext
disp
If rs.EOF = True Then
rs.MoveLast
End If
End If
End Sub
End Sub
End Sub
End Sub
Sub disp()
If rs.RecordCount >= 1 Then
Text1.Text = rs!user_id
Text2.Text = rs!Password
End If
End Sub
DOCTOR SPECIALIST
Dim db As Connection
Dim rs As Recordset, rs1 As Recordset
Dim X As Integer
End If
End Sub
rs.Update
Else
MsgBox "first add record and then update"
End If
X=0
End Sub
rs.Update
End Sub
End If
End If
End Sub
disp
If rs.EOF = True Then
rs.MoveLast
End If
End If
End Sub
End Sub
End Sub
End Sub
End Sub
Sub disp()
If rs.RecordCount >= 1 Then
Text1.Text = rs!s_code
Text2.Text = rs!spl_name
Text3.Text = rs!d_code
End If
End Sub
ROOM
Dim db As Connection
Dim rs As Recordset, rs1 As Recordset
Dim X As Integer
Text2.Text = ""
Combo2.Text = ""
Option1.Value = False
Option2.Value = False
Option3.Value = False
Option4.Value = False
Option5.Value = False
Option6.Value = False
Text4.Text = ""
Text5.Text = ""
Combo1.Text = ""
Text2.SetFocus
rs.AddNew
End If
End Sub
rs!charge = Text4.Text
rs!ward_code = Text5.Text
rs!dept = Combo1.Text
rs.Update
Else
MsgBox "first add record and then update"
End If
X=0
End Sub
rs.Update
End Sub
End Sub
Private Sub Command5_Click()
On Error Resume Next
If rs.RecordCount >= 1 Then
rs.MovePrevious
disp
If rs.BOF = True Then
rs.MoveFirst
End If
End If
End Sub
disp
If rs.EOF = True Then
rs.MoveLast
End If
End If
End Sub
End Sub
End Sub
End Sub
Combo1.AddItem "CARDIOLOGY"
Combo1.AddItem "NEUROLOGY"
Combo1.AddItem "Psychiatry"
Combo1.AddItem "ORTOAEDICS"
Combo1.AddItem "OBSTETRICS"
Combo2.AddItem "Special"
Combo2.AddItem "Normal"
End Sub
Sub disp()
If rs.RecordCount >= 1 Then
Text1.Text = rs!bed_no
Text2.Text = rs!room_code
Combo2.Text = rs!room_type
If rs!tv = "Y" Or rs!tv = "y" Then
Option1.Value = True
Else
Option2.Value = True
End If
If rs!ac = "Y" Or rs!ac = "y" Then
Option3.Value = True
Else
Option4.Value = True
End If
If rs!Status = "W" Or rs!Status = "w" Then
Option5.Value = True
Else
Option6.Value = True
End If
Text4.Text = rs!charge
Text5.Text = rs!ward_code
Combo1.Text = rs!dept
End If
End Sub
WARD MASTER
Dim db As Connection
Dim rs As Recordset, rs1 As Recordset
Dim X As Integer
End If
End Sub
End Sub
rs.Update
End Sub
End Sub
Private Sub Command5_Click()
On Error Resume Next
If rs.RecordCount >= 1 Then
rs.MovePrevious
disp
If rs.BOF = True Then
rs.MoveFirst
End If
End If
End Sub
disp
If rs.EOF = True Then
rs.MoveLast
End If
End If
End Sub
End Sub
End Sub
End Sub
Sub disp()
If rs.RecordCount >= 1 Then
Text1.Text = rs!ward_code
Text2.Text = rs!ward_name
Text3.Text = rs!incharge
End If
End Sub
SERVICES
Dim db As Connection
Dim rs As Recordset, rs1 As Recordset
Dim X As Integer
End If
End Sub
rs!incharge = Text3.Text
rs!fees = Text4.Text
rs.Update
Else
MsgBox "first add record and then update"
End If
X=0
End Sub
rs.Update
End Sub
End Sub
End If
End If
End Sub
disp
If rs.EOF = True Then
rs.MoveLast
End If
End If
End Sub
End Sub
End Sub
End Sub
Sub disp()
If rs.RecordCount >= 1 Then
Text1.Text = rs!sv_code
Text2.Text = rs!sv_name
If rs!Status = "G" Or rs!Status = "g" Then
Option1.Value = True
Else
Option2.Value = True
End If
Text3.Text = rs!incharge
Text4.Text = rs!fees
End If
End Sub
NURSING HOME
Dim db As Connection
Dim rs As Recordset
Dim X As Integer
Text1.SetFocus
rs.AddNew
End If
End Sub
Private Sub Command2_Click()
If X = 1 Then
rs!Name = Text1.Text
rs!addr1 = Text2.Text
rs!addr2 = Text3.Text
rs!city = Text4.Text
rs!pin = Text5.Text
rs!phone1 = Text6.Text
rs!phone2 = Text7.Text
rs!am_phone = Text8.Text
rs!mobile = Val(Text9.Text)
rs!head = Text10.Text
rs!visiting_date = Text11.Text
rs!remark = Text12.Text
rs.Update
Else
MsgBox "first add record and then update"
End If
X=0
End Sub
rs!phone1 = Text6.Text
rs!phone2 = Text7.Text
rs!am_phone = Text8.Text
rs!mobile = Text9.Text
rs!head = Text10.Text
rs!visiting_date = Text11.Text
rs!remark = Text12.Text
rs.Update
End Sub
End Sub
End If
End If
End Sub
disp
If rs.EOF = True Then
rs.MoveLast
End If
End If
End Sub
End Sub
End Sub
End Sub
disp
End Sub
Sub disp()
If rs.RecordCount >= 1 Then
Text1.Text = rs!Name
Text2.Text = rs!addr1
Text3.Text = rs!addr2
Text4.Text = rs!city
Text5.Text = rs!pin
Text6.Text = rs!phone1
Text7.Text = rs!phone2
Text8.Text = rs!am_phone
Text9.Text = rs!mobile
Text10.Text = rs!head
Text11.Text = rs!visiting_date
Text12.Text = rs!remark
End If
End Sub
EMPLOYEE
Dim db As Connection
Dim rs As Recordset, rs1 As Recordset
Dim X As Integer
Else
Text1.Text = 1
End If
rs.AddNew
End If
End Sub
rs!phone = Text5.Text
rs!mobile = Text6.Text
rs!addr1 = Text7.Text
rs!addr2 = Text8.Text
rs!c_code = Text9.Text
rs!s_code = Text10.Text
rs!degree = Text11.Text
rs!salary = Text12.Text
If Option3.Value = True Then
rs!Status = "G"
Else
rs!Status = "n"
End If
rs!promoter = Text13.Text
rs.Update
Else
MsgBox "first add record and then update"
End If
X=0
End Sub
End Sub
End Sub
End If
End If
End Sub
End If
End If
End Sub
End Sub
End Sub
End Sub
End Sub
Sub disp()
If rs.RecordCount >= 1 Then
Text1.Text = rs!emp_code
Text2.Text = rs!emp_f_name
Text3.Text = rs!emp_l_name
Text4.Text = rs!d_o_birth
End Sub
WARD
Dim db As Connection
Dim rs As Recordset
Dim X As Integer
End If
End Sub
rs.Update
Else
MsgBox "first add record and then update"
End If
X=0
End Sub
rs.Update
End Sub
End Sub
End If
End If
End Sub
disp
If rs.EOF = True Then
rs.MoveLast
End If
End If
End Sub
End Sub
End Sub
Sub disp()
If rs.RecordCount >= 1 Then
Text1.Text = rs!p_code
Text2.Text = rs!Test
Text3.Text = rs!charge
Text4.Text = rs!date_o_test
End If
End Sub
REPORT PATIENT INFORMATION
Dim db As Connection
Dim rs As Recordset
End Sub
End Sub
End Sub
Dim db As Connection
Dim rs As Recordset
Private Sub Command1_Click()
Unload Me
End Sub
End Sub
End Sub
If KeyCode = 13 Then
Command2_Click
End If
End Sub
REPORT BILL INFORMATION
Dim db As Connection
Dim rs As Recordset
End Sub
End Sub
Private Sub Command3_Click()
Set db = New ADODB.Connection
Set rs = New ADODB.Recordset
db.Open "provider=msdasql;dsn=pradeep;uid=medical;pwd=college"
rs.Open "select *from bill_info", db, adOpenStatic, adLockOptimistic
Set Adodc1.Recordset.DataSource = rs.DataSource
End Sub
End Sub
End Sub
REPORT ROOM
Dim db As Connection
Dim rs As Recordset
End Sub
End Sub
End Sub
End Sub