Program Address dengan VB
Ketik source code dibawah ini
Private Sub Command2_Click()
databar.Recordset.Delete
databar.Recordset.MovePrevious
End Sub
Private Sub Command3_Click()
databar.Recordset.Edit
End Sub
Private Sub Text1_Change()
End Sub
Private Sub Text1_GotFocus()
End Sub
Private Sub cmdAdd_Click()
databar.Recordset.AddNew
End Sub
Private Sub cmdExit_Click()
Unload Me
End
End Sub
Private Sub cmdNew_Click()
databar.Recordset.AddNew
End Sub
Private Sub cmdUpdate_Click()
databar.UpdateRecord
End Sub
Private Sub txtAddress_GotFocus()
txtAddress.SelStart = 0
txtAddress.SelLength = Len(txtAddress.Text)
End Sub
Private Sub txtCity_GotFocus()
txtCity.SelStart = 0
txtCity.SelLength = Len(txtCity.Text)
End Sub
Private Sub txtComments_GotFocus()
txtComments.SelStart = 0
txtComments.SelLength = Len(txtComments.Text)
End Sub
Private Sub txtEmail_GotFocus()
txtEmail.SelStart = 0
txtEmail.SelLength = Len(txtEmail.Text)
End Sub
Private Sub txtFirst_GotFocus()
txtFirst.SelStart = 0
txtFirst.SelLength = Len(txtFirst.Text)
End Sub
Private Sub txtLast_GotFocus()
txtLast.SelStart = 0
txtLast.SelLength = Len(txtLast.Text)
End Sub
Private Sub txtPhone_GotFocus()
txtPhone.SelStart = 0
txtPhone.SelLength = Len(txtPhone.Text)
End Sub
Private Sub txtState_GotFocus()
txtState.SelStart = 0
txtState.SelLength = Len(txtState.Text)
End Sub
Private Sub txtZip_GotFocus()
txtZip.SelStart = 0
txtZip.SelLength = Len(txtZip.Text)
End Sub
Private Sub txtHp_GotFocus()
txtHp.SelStart = 0
txtHp.SelLength = Len(txtHp.Text)
End Sub
Nb:
Buat programm database (table) di MsAccess
Field Name Data Type
fname Text
lname Text
address Text
city Text
state Text
zip Text
phone Text
hp Text
comments Text
extra text
simpan dan beri nama :AddressDatabase
Ketik source code dibawah ini
Private Sub Command2_Click()
databar.Recordset.Delete
databar.Recordset.MovePrevious
End Sub
Private Sub Command3_Click()
databar.Recordset.Edit
End Sub
Private Sub Text1_Change()
End Sub
Private Sub Text1_GotFocus()
End Sub
Private Sub cmdAdd_Click()
databar.Recordset.AddNew
End Sub
Private Sub cmdExit_Click()
Unload Me
End
End Sub
Private Sub cmdNew_Click()
databar.Recordset.AddNew
End Sub
Private Sub cmdUpdate_Click()
databar.UpdateRecord
End Sub
Private Sub txtAddress_GotFocus()
txtAddress.SelStart = 0
txtAddress.SelLength = Len(txtAddress.Text)
End Sub
Private Sub txtCity_GotFocus()
txtCity.SelStart = 0
txtCity.SelLength = Len(txtCity.Text)
End Sub
Private Sub txtComments_GotFocus()
txtComments.SelStart = 0
txtComments.SelLength = Len(txtComments.Text)
End Sub
Private Sub txtEmail_GotFocus()
txtEmail.SelStart = 0
txtEmail.SelLength = Len(txtEmail.Text)
End Sub
Private Sub txtFirst_GotFocus()
txtFirst.SelStart = 0
txtFirst.SelLength = Len(txtFirst.Text)
End Sub
Private Sub txtLast_GotFocus()
txtLast.SelStart = 0
txtLast.SelLength = Len(txtLast.Text)
End Sub
Private Sub txtPhone_GotFocus()
txtPhone.SelStart = 0
txtPhone.SelLength = Len(txtPhone.Text)
End Sub
Private Sub txtState_GotFocus()
txtState.SelStart = 0
txtState.SelLength = Len(txtState.Text)
End Sub
Private Sub txtZip_GotFocus()
txtZip.SelStart = 0
txtZip.SelLength = Len(txtZip.Text)
End Sub
Private Sub txtHp_GotFocus()
txtHp.SelStart = 0
txtHp.SelLength = Len(txtHp.Text)
End Sub
Nb:
Buat programm database (table) di MsAccess
Field Name Data Type
fname Text
lname Text
address Text
city Text
state Text
zip Text
phone Text
hp Text
comments Text
extra text
simpan dan beri nama :AddressDatabase
0 komentar:
Posting Komentar
Mohon Tidak Mengirim Spam : Karena Setiap Spam akan kami hapus