Professional Documents
Culture Documents
Visual Basic Codes Collection
Visual Basic Codes Collection
Visual Basic Codes Collection
txtfname.Text = ""
txtsurname.Text = "" SAVE CODE
rs.Fields("CandidateNum").Value = clear
txtcandidate.Text
End Sub
rs.Fields("Fname").Value = txtfname.Text
Sub display() FIRST RECORD CODE
txtcandidate.Text = rs!CandidateNum Private Sub cmdFirst_Click(Index As
Integer)
txtfname.Text = rs!Fname
rs.MoveFirst
txtsurname.Text = rs!Surname
display
combogender.Text = rs!Gender
End Sub
txtdob.Text = rs!DOB
comboclass.Text = rs!Class
LAST RECORD CODE
txtamount.Text = rs!Amount
Private Sub cmdLast_Click(Index As
End Sub
Integer)
rs.MoveLast
display
Sub clear()
End Sub
txtcandidate.Text = ""
txtfname.Text = ""
txtsurname.Text = ""
NEXT RECORD CODE
combogender.Text = "-Select gender-"
Private Sub cmdNext_Click()
txtdob.Text = ""
rs.MoveNext
comboclass.Text = "-Select class-"
If Not rs.EOF Then
txtamount.Text = ""
display
End Sub
Else
MsgBox "There are no more records to
Sub reload() navigate", vbInformation
rs.Close rs.MoveFirst
display rs.MovePrevious
End If display
Else display
rs.Fields("Qualification").Value = conn.Close
txtqualification.Text
'search
rs.Fields("Designation").Value =
'refreshdata
txtdesignation.Text
End Sub
rs.Fields("StartDate").Value =
txtstartdate.Text
rs.Fields("Address").Value = txtaddress.Text
rs.Fields("PhoneNum").Value =
txtphone.Text
Sub search()
rs.Fields("Photo").Value = str
AdoCON.RecordSource = "Select * from
MsgBox "Record saved successfully!!", ProfileTB where ECNum='" + txtec.Text +
vbInformation "' or Surname='" + txtSearch.Text + "'"
rs.Update AdoCON.Refresh
End Sub If AdoCON.Recordset.EOF Then
MsgBox "Record not found, please enter rs.Fields("PhoneNum").Value =
anothe EC Number or Surname to search", txtphone.Text
vbCritical, "Message"
rs.Fields("Photo").Value = str
End If
MsgBox "Record updated successfully!!",
End Sub vbInformation
Sub reload() rs.Update
rs.Close End Sub
rs.Open "Select * from ProfileTB", conn,
adOpenDynamic, adLockPessimistic
Private Sub cmdUpload_Click()
End Sub
CommonDialog1.ShowOpen
CommonDialog1.Filter = "Jpeg|*.jpg"
Private Sub cmdUpdate_Click()
str = CommonDialog1.FileName
rs.Fields("ECNum").Value = txtec.Text
Picture1.Picture = LoadPicture(str)
rs.Fields("Surname").Value =
End Sub
txtsurname.Text
rs.Fields("Names").Value = txtnames.Text
Private Sub Form_Load()
rs.Fields("DOB").Value = txtdob.Text
'Me.Hide
If Option1.Value = True Then
'Login.Show
rs.Fields("Gender") = Option1.Caption
conn.Open
Else
"Provider=Microsoft.Jet.OLEDB.4.0;Data
rs.Fields("Gender") = Option2.Caption Source=C:\Users\Mashava\Documents\
ProfileDB.mdb;Persist Security Info=False"
End If
'AdoCON.
rs.Fields("Department").Value =
"Provider=Microsoft.Jet.OLEDB.4.0;Data
Combo1.Text
Source=C:\Users\Mashava\Documents\
rs.Fields("Qualification").Value = ProfileDB.mdb;Persist Security Info=False"
txtqualification.Text
rs.Open "Select * from ProfileTB", conn,
rs.Fields("Designation").Value = adOpenDynamic, adLockPessimistic
txtdesignation.Text
rs.Fields("StartDate").Value =
Combo1.AddItem "SCIENCE"
txtstartdate.Text
Combo1.AddItem "MATHEMATICS"
rs.Fields("Address").Value = txtaddress.Text
Combo1.AddItem "COMMERCIALS" Private Sub cmdSearch_Click()
Combo1.AddItem "HUMANITIES" AdoCON.RecordSource = "Select * from
ProfileTB where ECNum='" +
Combo1.AddItem "PRACTICALS"
txtSearch.Text + "' or Surname='" +
Combo1.AddItem "ENGLISH" txtSearch.Text + "'"
'display AdoCON.Refresh