5. Double Click on the cmdBill button and write codes in between cmdBill_Click ( ) event procedure.
Private Sub cmdBill_Click( )
frmBill.Show
End Sub
6. Double Click on the lblExit button and write codes in between cmdExit_Click ( ) event procedure.
Private Sub lblExit_Click( )
End
End Sub
7. Now add a new Form Control. Change Form Name property to “frmPatient”, Caption
property to "Patient", BorderStyle property to “1-FixedSingle”, StartupPosition to "2-
CenterScreen" and Icon to "Any Icon ".
8. Add ADODC control to the toolbox by clicking at Project Menu on the menu bar, then select
Components or use Ctrl + T shortcut key from the keyboard, Now we can see a components
dialog box check Microsoft ADO Data Control 6.0 (OLEDB) from the list then click ok button.
Now we can see ADODC control on the toolbox. Select it and add it to the frmPatient
Form, Change its Name property to AdoPatient .
9. Now right click on it using mouse and select ADODC Properties. Now click Build Button select
Microsoft OLE DB Provider for Oracle from the list, Click Next button, Enter User name scott
& Password tiger, Check Allow saving Password Checkbox and Click Test Connection, Click Ok.
Now move to RecordSource tab then select Command Type to 2-adCmdTable Now select
Table or Stored Procedure Name to PATIENT (Table Created before) and Click Ok Button.
10. Add following controls to the Form (frmPatient) control with following properties settings:
Sr. No
|
Control
|
Properties
|
Settings
|
1
|
Label
|
Caption
|
BedNo
|
2
|
Label
|
Caption
|
Name
|
3
|
Label
|
Caption
|
DOB
|
4
|
Label
|
Caption
|
Father's Name
|
5
|
Label
|
Caption
|
Address
|
6
|
Label
|
Caption
|
Sex
|
7
|
Label
|
Caption
|
Disease
|
8
|
Textbox
|
Name
|
txtBedno
|
Text
|
Blank
| ||
DataSource
|
AdoPatient
| ||
DataField
|
BEDNO
| ||
9
|
Textbox
|
Name
|
txtName
|
Text
|
Blank
| ||
DataSource
|
AdoPatient
| ||
DataField
|
NAME
| ||
10
|
Textbox
|
Name
|
txtDOB
|
Text
|
Blank
| ||
DataSource
|
AdoPatient
| ||
DataField
|
DOB
| ||
11
|
Textbox
|
Name
|
txtFathername
|
Text
|
Blank
| ||
DataSource
|
AdoPatient
| ||
DataField
|
FATHERNAME
| ||
12
|
Textbox
|
Name
|
txtAddress
|
Text
|
Blank
| ||
DataSource
|
AdoPatient
| ||
DataField
|
Address
| ||
13
|
ComboBox
|
Name
|
cboSex
|
List
|
MALE, FEMALE
| ||
Style
|
2-Dropdown List
| ||
DataSource
|
AdoPatient
| ||
DataField
|
SEX
| ||
14
|
Textbox
|
Name
|
txtDisease
|
Text
|
Blank
| ||
DataSource
|
AdoPatient
| ||
DataField
|
DISEASE
| ||
15
|
CommandButton
|
Name
|
cmdAdd
|
Caption
|
&Add
| ||
16
|
CommandButton
|
Name
|
cmdSave
|
Caption
|
&Save
| ||
17
|
CommandButton
|
Name
|
cmdDelete
|
Caption
|
&Delete
|
11. Double Click on the cmdAdd button and write codes in between cmdAdd_Click ( ) event procedure.
Private Sub cmdAdd_Click( )
AdoPatient.Recordset.AddNew
txtBedno.Setfocus