You are on page 1of 3

Private Sub cmbnm_LostFocus()

Adodc2.Refresh
On Error Resume Next
Do While Not Adodc2.Recordset.EOF = True
If Adodc2.Recordset!Name = cmbnm.Text Then
Txtadd.Text = Adodc2.Recordset!address
txtexch.Text = Adodc2.Recordset!Exchange
Txtpin.Text = Adodc2.Recordset!pin_code
Exit Do
Else
End If
Adodc2.Recordset.MoveNext
Loop
End Sub
Private Sub cmbpl_LostFocus()
Text1.Text = cmbpl.Text
End Sub
Private Sub cmdad_Click()
Adodc1.Refresh
Adodc1.Recordset.AddNew
Txtadd.Text = ""
cmdsv.Visible = True
cmdad.Visible = False
cmbnm.Visible = True
Txtadd.Visible = True
cmbnm.SetFocus
End Sub
Private Sub cmdex_Click()
Unload Me
End Sub
Private Sub cmdrf_Click()
txtcust.Text = ""
cmbnm.Text = ""
Txtadd.Text = ""
Txttel.Text = ""
cmbpl.Text = ""
txtexch.Text = ""
Txtpin.Text = ""
Adodc1.Refresh
Adodc2.Refresh
db1.Refresh
End Sub
Private Sub cmdsv_Click()
If op1_a.Value = True Then
add_p = op1_a.Caption
Else
If op2_a.Value = True Then

add_p = op2_a.Caption
Else
If op3_a.Value = True Then
add_p = op3_a.Caption
Else
If op4_a.Value = True Then
add_p = op4_a.Caption
End If
End If
End If
End If
If op1_i.Value = True Then
Id_p = op1_a.Caption
Else
If op2_i.Value = True Then
Id_p = op2_i.Caption
Else
If op3_i.Value = True Then
Id_p = op3_i.Caption
Else
If op4_i.Value = True Then
Id_p = op4_i.Caption
Else
If op5_i.Value = True Then
Id_p = op5_i.Caption
End If
End If
End If
End If
End If
Adodc1.Recordset.Fields(0)
Adodc1.Recordset.Fields(1)
Adodc1.Recordset.Fields(2)
Adodc1.Recordset.Fields(3)
Adodc1.Recordset.Fields(5)
Adodc1.Recordset.Fields(6)
Adodc1.Recordset.Fields(4)
Adodc1.Recordset.Fields(7)
Adodc1.Recordset.Fields(8)
Adodc1.Recordset.Save
Txtadd.Text = ""
cmbnm.Text = ""
txtcust.Text = ""
Txttel.Text = ""
cmbpl.Text = ""
txtexch.Text = ""
Txtpin.Text = ""
cmdsv.Visible = False
cmdad.Visible = True

=
=
=
=
=
=
=
=
=

cmbnm.Text
Txtadd.Text
txtcust.Text
Txttel.Text
add_p.Text
Id_p.Text
Text1.Text
Txtpin.Text
txtexch.Text

MsgBox "Record Save Successfuly"


End Sub
Private Sub Form_Load()
Txtadd.Text = ""
cmbnm.Text = ""

txtcust.Text = ""
Txttel.Text = ""
cmbpl.Text = ""
txtexch.Text = ""
Txtpin.Text = ""
cmdad.Visible = True
If cmdad.Visible = False Then
cmbnm.Visible = False
Txtadd.Visible = False
End If
While Adodc2.Recordset.EOF = False
cmbnm.AddItem (Adodc2.Recordset!Name)
Adodc2.Recordset.MoveNext
Wend
While db1.Recordset.EOF = False
cmbpl.AddItem (db1.Recordset.Fields(0))
db1.Recordset.MoveNext
Wend
End Sub
Private Sub txtcust_GotFocus()
Dim a, b As Integer
a = (DateTime.Month(Date) + DateTime.Day(Date) + DateTime.Year(Date))
b = DateTime.Minute(Time) + DateTime.Hour(Time) + DateTime.Second(Time)
txtcust.Text = (a) & a + b
End Sub

You might also like