12. Write a VB program to accept the details of doctor having fields dno, dname, address, phone number. Display those details on to the grid.


Private Sub Command1_Click()
Static i As Integer
For j = 1 To MSFlexGrid1.Cols – 1
MSFlexGrid1.Row = i + 1
MSFlexGrid1.Col = j
MSFlexGrid1.Text = Text1.Item(j)
Text1.Item(j) = “”
Next
i = i + 1
End Sub

Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Load()

Dim Items(6) As String
Dim i As Integer
MSFlexGrid1.Col = 0
MSFlexGrid1.Row = 0
MSFlexGrid1.Text = “Sr.No”
For i = 1 To MSFlexGrid1.Rows – 1
MSFlexGrid1.Col = 0
MSFlexGrid1.Row = i
MSFlexGrid1.Text = i
Next

MSFlexGrid1.Row = 0
MSFlexGrid1.Col = 1
MSFlexGrid1.Text = “Doctor No”
MSFlexGrid1.Col = 2
MSFlexGrid1.Text = “Docotr Name”
MSFlexGrid1.Col = 3
MSFlexGrid1.Text = “Address”
MSFlexGrid1.Col = 4
MSFlexGrid1.Text = “Phone Number”

For i = 1 To MSFlexGrid1.Cols – 1
MSFlexGrid1.ColWidth(i) = 1300
Next
End Sub

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s