Creating an Ordering System Using EVB - Screen 2, the Main Screen
(Page 4 of 7 )
Screen 2 (Main Screen)

Code:
Option Explicit
Dim ttsql As String
Dim Prs As Recordset
Private Sub btnClose_Click()
frameActionChoice.Visible = True
framePM.Visible = False
End Sub
Private Sub btnDC_Click()
frmPM.UserName = lblUserName.Caption
frmPM.Show
End Sub
Private Sub btnLogoff_Click()
frmLogin.Show
frmLogin.SetFocus
frmLogin.txtUserName.Text = ""
frmLogin.txtPassword.Text = ""
frmLogin.txtUserName.SetFocus
End Sub
Private Sub btnPMaster_Click()
'frmPM.Show
frameActionChoice.Visible = True
framePM.Visible = True
End Sub
Private Sub Form_Load()
framePM.Visible = False
frameActionChoice.Visible = True
Call LoadData
End Sub
Private Sub LoadData()
On Error GoTo 0
Set Prs = CreateObject("ADOCE.RECORDSET.3.0")
ttsql = "select PName from Patient_Master"
Prs.Open ttsql
Do While Not Prs.EOF
cmbPatient.AddItem Trim(Prs.Fields("PName").Value)
Prs.MoveNext
Loop
Prs.Close
Set Prs = Nothing
End Sub
Private Sub cmbPatient_Click()
Set Prs = CreateObject("ADOCE.RECORDSET.3.0")
ttsql = "select PhoneNo,Address from Patient_Master where PName='" & Trim(cmbPatient.Text) & "'"
Prs.Open ttsql
If Not Prs.EOF Then
txtPhoneNo.Text = Prs.Fields("PhoneNo").Value
txtAddress.Text = Prs.Fields("Address").Value
Else
txtPhoneNo.Text = ""
txtAddress.Text = ""
End If
Prs.Close
Set Prs = Nothing
End Sub
Next: Screen 3, the Customer Information >>
More Code Examples Articles
More By Vishal Rajpara