TUGAS VB 2

kode program tugas vb 2 :

Private Sub cmdedit_Click()
Data1.Recordset.Edit
End Sub

Private Sub cmdhapus_Click()
Data1.Recordset.Delete
End Sub

Private Sub cmdkeluar_Click()
MsgBox "apakah anda yakin akan keluar????", vbYesNo
Unload Me
End Sub

Private Sub cmdsimpan_Click()
Data1.Recordset.Update
End Sub

Private Sub cmdtambah_Click()
Data1.Recordset.AddNew
txtnpm.SetFocus
End Sub

Private Sub Form_Load()

Cbojeniskelamin.AddItem "laki-laki"
Cbojeniskelamin.AddItem "perempuan"

Cboagama.AddItem "Islam"
Cboagama.AddItem "Katolik"
Cboagama.AddItem "Protestan"
Cboagama.AddItem "Hindu"
Cboagama.AddItem "Budha"
Cboagama.AddItem "Konghucu"

cbokelas.AddItem "Yahoo S1"
cbokelas.AddItem "Yahoo D3"
cbokelas.AddItem "Visual Basic S1"
cbokelas.AddItem " Visual Basic D3"
cbokelas.AddItem "Facebook S1"
cbokelas.AddItem "Facebook D3"
cbokelas.AddItem "Dhelpy S1"
cbokelas.AddItem "Dhelpy D3"
cbokelas.AddItem "Msycl S1"
cbokelas.AddItem "Msycl D3"
cbokelas.AddItem "Website S1"
cbokelas.AddItem "Website D3"

cbostatus.AddItem "Kakek"
cbostatus.AddItem "Nenek"
cbostatus.AddItem "Ayah"
cbostatus.AddItem "Ibu"
cbostatus.AddItem "Oom"
cbostatus.AddItem "Tante"
cbostatus.AddItem "Pakde"
cbostatus.AddItem "Bukde"

End Sub

PROGRAM HOTEL BALONG KURING


 

Private Sub cmdcancel_Click()
Unload Me
End Sub
Private Sub cmdok_Click()
If txtSERVER.Text = "Komp1" And txtusername.Text = "ARIYANI" And txtpassworduser = "amor" Then
frmSplash.Show
Else
MsgBox "Periksa Kembali Password yang Anda Masukan...!!?"
End If
End Sub
Private Sub Form_Activate()
txtpassworduser.SetFocus
End Sub
Private Sub Form_Load()
bersih
End Sub
Private Sub bersih()
txtSERVER.Text = "Komp1"
txtusername.Text = "ARIYANI"
txtpassworduser.Text = ""
End Sub

Private Sub txtusername_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtpassworduser.SetFocus
End If
End Sub




Option Explicit
Dim iSplash As Integer

Private Sub Form_KeyPress(KeyAscii As Integer)
    Unload Me
End Sub
Private Sub Frame1_Click()
    Unload Me
End Sub

Private Sub Timer1_Timer()
On Error Resume Next
iSplash = iSplash + 1
prghotel.Value = prghotel.Value + 1000 / 1000
If iSplash > 100 Then
    Timer1.Enabled = False
    Screen.MousePointer = vbNormal
    Me.WindowState = 0
    Do
    Me.Left = Me.Left + 3000
    Me.Move Me.Left, Me.Top
    DoEvents
    Loop Until Me.Left > Screen.Width
    Load frmmenu
    frmmenu.Show
    frmmenu.SetFocus
    Unload Me
End If
End Sub





Private Sub mnuexit_Click()
PSN = MsgBox("ANDA YAKIN MAU KELUAR?", vbCritical + vbYesNo, "PESAN")
If PSN = vbYes Then
Unload Me
End If
End Sub

Private Sub mnujasa_Click()
frmjasa.Show
End Sub

Private Sub mnukamar_Click()
frmkamar.Show
End Sub


Private Sub mnulaporan_Click()
frmlaporan.Show
End Sub

Private Sub mnutamu_Click()
frmtamu.Show
End Sub

Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button)
If Button.Index = 1 Then
frmtamu.Show
ElseIf Button.Index = 2 Then
frmkamar.Show
ElseIf Button.Index = 3 Then
frmjasa.Show
ElseIf Button.Index = 4 Then
PSN = MsgBox("ANDA YAKIN MAU KELUAR?", vbQuestion + vbYesNo, "PESAN")
If PSN = vbYes Then
Unload Me
End If
End If
End Sub





Private Sub cmdtutup_Click()
PSN = MsgBox("ANDA YAKIN MAU KELUAR?", vbQuestion + vbYesNo, "PESAN")
If PSN = vbYes Then
Unload Me
End If
End Sub

Private Sub CMDHAPUS_Click()
Dim dbhotel As New ADODB.Connection
Dim rstbtamu As ADODB.Recordset
dbhotel.Open constring, username, passworduser
dbhotel.Execute "Delete from tbtamu where kodetamu = '" & txtkodetamu.Text & "'"
bersih
End Sub

Private Sub cmdsimpan_Click()
Dim dbhotel As New ADODB.Connection
Dim rstbtamu As ADODB.Recordset
dbhotel.Open constring, username, passworduser
Set rstbtamu = dbhotel.Execute("select * from tbtamu where kodetamu ='" & txtkodetamu.Text & "'")
If rstbtamu.EOF Then
dbhotel.Execute ("insert into tbtamu(kodetamu,namatamu,noidentitas,notelp,alamat) values ('" & txtkodetamu.Text & "' , '" & txtnamatamu.Text & "' , '" & txtnoidentitas.Text & "','" & txtnotelp.Text & "','" & txtalamat.Text & "')")
Else
If MsgBox("data ini sudah ada dalam database," & " perbaiki?", vbQuestion + vbYesNo, "konfirmasi") Then
dbhotel.Execute "update tbtamu set namatamu ='" & txtnamatamu.Text & "', noidentitas='" & txtnoidentitas.Text & "', notelp= '" & txtnotelp.Text & "', alamat='" & txtalamat.Text & "' where kodetamu= '" & txtkodetamu.Text & "'"
End If
End If
bersih
End Sub

Private Sub Form_Load()
bersih
Adodc1.ConnectionString = constring
Adodc1.RecordSource = "select * from tbtamu"
End Sub

Private Sub bersih()
txtkodetamu.Text = ""
txtnamatamu.Text = ""
txtnoidentitas.Text = ""
txtnotelp.Text = ""
txtalamat.Text = ""
End Sub

Private Sub cmdbersih_Click()
bersih
End Sub

Private Sub txtalamat_Change()
kodenya
End Sub

Private Sub txtnamatamu_Change()
Dim dbhotel As New ADODB.Connection
Dim rstbtamu As ADODB.Recordset
dbhotel.Open constring
Set rstbtamu = dbhotel.Execute("select *from tbtamu where namatamu = '" & txtnamatamu.Text & "'")
txtnoidentitas.Text = ""
txtkodetamu.Text = ""
txtnotelp.Text = ""
txtalamat.Text = ""
If Not rstbtamu.EOF Then
txtkodetamu.Text = rstbtamu!kodetamu
txtnamatamu.Text = rstbtamu!namatamu
txtnoidentitas.Text = rstbtamu!noidentitas
txtnotelp.Text = rstbtamu!notelp
txtalamat.Text = rstbtamu!alamat
End If
txtkodetamu.Refresh
txtnamatamu.Refresh
txtnoidentitas.Refresh
txtnotelp.Refresh
txtalamat.Refresh
End Sub

Private Sub txtnamatamu_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtnoidentitas.SetFocus
End If
End Sub

Private Sub txtnoidentitas_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtnotelp.SetFocus
End If
End Sub

Private Sub txtnotelp_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtalamat.SetFocus
End If
End Sub

Private Sub kodenya()
txtkodetamu.Text = Left(txtnamatamu.Text, 2) & Left(txtnoidentitas.Text, 4)
End Sub





Private Sub cbokodekamar_Click()
If cbonokamar.Text = "1" Then
lblKamar.Caption = "vip"
lblLantai.Caption = "I"
lblFasilitas.Caption = "televisi + 4 single bed + kulkas"
lblTarif.Caption = "Rp. " & "300000"

ElseIf cbonokamar.Text = "2" Then
lblKamar.Caption = "utama-1"
lblLantai.Caption = "I"
lblFasilitas.Caption = "televisi + 4 single bed"
lblTarif.Caption = "Rp. " & "200000"

ElseIf cbonokamar.Text = "3" Then
lblKamar.Caption = "utama-2"
lblLantai.Caption = "I"
lblFasilitas.Caption = "televisi + double + single spring bed"
lblTarif.Caption = "Rp. " & "250000"

ElseIf cbonokamar.Text = "4" Then
lblKamar.Caption = "utama-3"
lblLantai.Caption = "I"
lblFasilitas.Caption = "televisi + 3 single bed"
lblTarif.Caption = "Rp. " & "150000"

ElseIf cbonokamar.Text = "5" Then
lblKamar.Caption = "kelas-1"
lblLantai.Caption = "I"
lblFasilitas.Caption = "single bed"
lblTarif.Caption = "Rp. " & "150000"

ElseIf cbonokamar.Text = "6" Then
lblKamar.Caption = "kelas-2"
lblLantai.Caption = "I"
lblFasilitas.Caption = "3 single bed"
lblTarif.Caption = "Rp. " & "150000"

ElseIf cbonokamar.Text = "7" Then
lblKamar.Caption = "kelas-3"
lblLantai.Caption = "I"
lblFasilitas.Caption = "double + single bed"
lblTarif.Caption = "Rp. " & "150000"

ElseIf cbonokamar.Text = "8" Then
lblKamar.Caption = "vip"
lblLantai.Caption = "II"
lblFasilitas.Caption = "televisi + 4 single bed + kulkas"
lblTarif.Caption = "Rp. " & "300000"

ElseIf cbonokamar.Text = "9" Then
lblKamar.Caption = "utama-1"
lblLantai.Caption = "II"
lblFasilitas.Caption = "televisi + 4 single bed"
lblTarif.Caption = "Rp. " & "200000"

ElseIf cbonokamar.Text = "10" Then
lblKamar.Caption = "utama-2"
lblLantai.Caption = "II"
lblFasilitas.Caption = "televisi + double + single spring bed"
lblTarif.Caption = "Rp. " & "250000"

ElseIf cbonokamar.Text = "11" Then
lblKamar.Caption = "utama-3"
lblLantai.Caption = "II"
lblFasilitas.Caption = "televisi + 3 single bed"
lblTarif.Caption = "Rp. " & "150000"

ElseIf cbonokamar.Text = "12" Then
lblKamar.Caption = "kelas-1"
lblLantai.Caption = "II"
lblFasilitas.Caption = "single bed"
lblTarif.Caption = "Rp. " & "150000"

ElseIf cbonokamar.Text = "13" Then
lblKamar.Caption = "kelas-2"
lblLantai.Caption = "II"
lblFasilitas.Caption = "3 single bed"
lblTarif.Caption = "Rp. " & "150000"

ElseIf cbonokamar.Text = "14" Then
lblKamar.Caption = "kelas-3"
lblLantai.Caption = "II"
lblFasilitas.Caption = "double + single bed"
lblTarif.Caption = "Rp. " & "150000"

ElseIf cbonokamar.Text = "15" Then
lblKamar.Caption = "vip"
lblLantai.Caption = "II"
lblFasilitas.Caption = "televisi + 4 single bed + kulkas"
lblTarif.Caption = "Rp. " & "300000"

ElseIf cbonokamar.Text = "16" Then
lblKamar.Caption = "utama-1"
lblLantai.Caption = "II"
lblFasilitas.Caption = "televisi + 4 single bed"
lblTarif.Caption = "Rp. " & "200000"

ElseIf cbonokamar.Text = "17" Then
lblKamar.Caption = "utama-2"
lblLantai.Caption = "III"
lblFasilitas.Caption = "televisi + double + single spring bed"
lblTarif.Caption = "Rp. " & "250000"

ElseIf cbonokamar.Text = "18" Then
lblKamar.Caption = "utama-3"
lblLantai.Caption = "III"
lblFasilitas.Caption = "televisi + 3 single bed"
lblTarif.Caption = "Rp. " & "150000"

ElseIf cbonokamar.Text = "19" Then
lblKamar.Caption = "kelas-1"
lblLantai.Caption = "III"
lblFasilitas.Caption = "single bed"
lblTarif.Caption = "Rp. " & "150000"

ElseIf cbonokamar.Text = "20" Then
lblKamar.Caption = "kelas-2"
lblLantai.Caption = "III"
lblFasilitas.Caption = "3 single bed"
lblTarif.Caption = "Rp. " & "150000"

ElseIf cbonokamar.Text = "21" Then
lblKamar.Caption = "kelas-3"
lblLantai.Caption = "III"
lblFasilitas.Caption = "double + single bed"
lblTarif.Caption = "Rp. " & "150000"

Dim dbhotel As New ADODB.Connection
Dim rstbkamar As ADODB.Recordset
dbhotel.Open constring, username, passworduser
Set rstbkamar = dbhotel.Execute("select *from tbkamar where nokamar = '" & cbonokamar.Text & "'")
If Not rstbkamar.EOF Then
cbonokamar.Text = rstbkamar!nokamar
lblKamar.Caption = rstbkamar!jeniskamar
lblLantai.Caption = rstbkamar!lantai
lblFasilitas.Caption = rstbkamar!fasilitas
lblTarif.Caption = rstbkamar!tarif

End If

If cbonokamar.Text = "" Then
bersih
End If
End If
bersih
End Sub

Private Sub cbonokamar_Click()
If cbonokamar.Text = "1" Then
lblKamar.Caption = "vip"
lblLantai.Caption = "I"
lblFasilitas.Caption = "televisi + 4 single bed + kulkas"
lblTarif.Caption = "Rp. " & "300000"

ElseIf cbonokamar.Text = "2" Then
lblKamar.Caption = "utama-1"
lblLantai.Caption = "I"
lblFasilitas.Caption = "televisi + 4 single bed"
lblTarif.Caption = "Rp. " & "200000"

ElseIf cbonokamar.Text = "3" Then
lblKamar.Caption = "utama-2"
lblLantai.Caption = "I"
lblFasilitas.Caption = "televisi + double + single spring bed"
lblTarif.Caption = "Rp. " & "250000"

ElseIf cbonokamar.Text = "4" Then
lblKamar.Caption = "utama-3"
lblLantai.Caption = "I"
lblFasilitas.Caption = "televisi + 3 single bed"
lblTarif.Caption = "Rp. " & "150000"

ElseIf cbonokamar.Text = "5" Then
lblKamar.Caption = "kelas-1"
lblLantai.Caption = "I"
lblFasilitas.Caption = "single bed"
lblTarif.Caption = "Rp. " & "150000"

ElseIf cbonokamar.Text = "6" Then
lblKamar.Caption = "kelas-2"
lblLantai.Caption = "I"
lblFasilitas.Caption = "3 single bed"
lblTarif.Caption = "Rp. " & "150000"

ElseIf cbonokamar.Text = "7" Then
lblKamar.Caption = "kelas-3"
lblLantai.Caption = "I"
lblFasilitas.Caption = "double + single bed"
lblTarif.Caption = "Rp. " & "150000"

ElseIf cbonokamar.Text = "8" Then
lblKamar.Caption = "vip"
lblLantai.Caption = "II"
lblFasilitas.Caption = "televisi + 4 single bed + kulkas"
lblTarif.Caption = "Rp. " & "300000"

ElseIf cbonokamar.Text = "9" Then
lblKamar.Caption = "utama-1"
lblLantai.Caption = "II"
lblFasilitas.Caption = "televisi + 4 single bed"
lblTarif.Caption = "Rp. " & "200000"

ElseIf cbonokamar.Text = "10" Then
lblKamar.Caption = "utama-2"
lblLantai.Caption = "II"
lblFasilitas.Caption = "televisi + double + single spring bed"
lblTarif.Caption = "Rp. " & "250000"

ElseIf cbonokamar.Text = "11" Then
lblKamar.Caption = "utama-3"
lblLantai.Caption = "II"
lblFasilitas.Caption = "televisi + 3 single bed"
lblTarif.Caption = "Rp. " & "150000"

ElseIf cbonokamar.Text = "12" Then
lblKamar.Caption = "kelas-1"
lblLantai.Caption = "II"
lblFasilitas.Caption = "single bed"
lblTarif.Caption = "Rp. " & "150000"

ElseIf cbonokamar.Text = "13" Then
lblKamar.Caption = "kelas-2"
lblLantai.Caption = "II"
lblFasilitas.Caption = "3 single bed"
lblTarif.Caption = "Rp. " & "150000"

ElseIf cbonokamar.Text = "14" Then
lblKamar.Caption = "kelas-3"
lblLantai.Caption = "II"
lblFasilitas.Caption = "double + single bed"
lblTarif.Caption = "Rp. " & "150000"

ElseIf cbonokamar.Text = "15" Then
lblKamar.Caption = "vip"
lblLantai.Caption = "II"
lblFasilitas.Caption = "televisi + 4 single bed + kulkas"
lblTarif.Caption = "Rp. " & "300000"

ElseIf cbonokamar.Text = "16" Then
lblKamar.Caption = "utama-1"
lblLantai.Caption = "II"
lblFasilitas.Caption = "televisi + 4 single bed"
lblTarif.Caption = "Rp. " & "200000"

ElseIf cbonokamar.Text = "17" Then
lblKamar.Caption = "utama-2"
lblLantai.Caption = "III"
lblFasilitas.Caption = "televisi + double + single spring bed"
lblTarif.Caption = "Rp. " & "250000"

ElseIf cbonokamar.Text = "18" Then
lblKamar.Caption = "utama-3"
lblLantai.Caption = "III"
lblFasilitas.Caption = "televisi + 3 single bed"
lblTarif.Caption = "Rp. " & "150000"

ElseIf cbonokamar.Text = "19" Then
lblKamar.Caption = "kelas-1"
lblLantai.Caption = "III"
lblFasilitas.Caption = "single bed"
lblTarif.Caption = "Rp. " & "150000"

ElseIf cbonokamar.Text = "20" Then
lblKamar.Caption = "kelas-2"
lblLantai.Caption = "III"
lblFasilitas.Caption = "3 single bed"
lblTarif.Caption = "Rp. " & "150000"

End If
Dim dbhotel As New ADODB.Connection
Dim rstbkamar As ADODB.Recordset
dbhotel.Open constring, username, passworduser
Set rstbkamar = dbhotel.Execute("select *from tbkamar where nokamar = '" & cbonokamar.Text & "'")
If Not rstbkamar.EOF Then
cbonokamar.Text = rstbkamar!nokamar
lblKamar.Caption = rstbkamar!jeniskamar
lblLantai.Caption = rstbkamar!lantai
lblFasilitas.Caption = rstbkamar!fasilitas
lblTarif.Caption = rstbkamar!tarif

End If
If cbonokamar.Text = "" Then
bersih
End If
If cbonokamar.Text = "21" Then
lblKamar.Caption = "kelas-3"
lblLantai.Caption = "III"
lblFasilitas.Caption = "double + single bed"
lblTarif.Caption = "Rp. " & "150000"
End If
End Sub


Private Sub cmdkembali_Click()
frmtamu.Show
Unload Me
End Sub

Private Sub cmdtutup_Click()
PSN = MsgBox("ANDA YAKIN MAU KELUAR?", vbQuestion + vbYesNo, "PESAN")
If PSN = vbYes Then
Unload Me
End If
End Sub

Private Sub CMDHAPUS_Click()
Dim dbhotel As New ADODB.Connection
Dim rstbkamar As ADODB.Recordset
dbhotel.Open constring, username, passworduser
dbhotel.Execute "Delete from tbkamar where nokamar ='" & cbonokamar.Text & "'"
bersih
End Sub

Private Sub cmdsimpan_Click()
Dim dbhotel As New ADODB.Connection
Dim rstbkamar As ADODB.Recordset
dbhotel.Open constring, username, passworduser
Set rstbkamar = dbhotel.Execute("select * from tbkamar where nokamar ='" & cbonokamar.Text & "'")
If rstbkamar.EOF Then
dbhotel.Execute ("insert into tbkamar(nokamar,jeniskamar,lantai,fasilitas,tarif) values ('" & cbonokamar.Text & "','" & lblKamar.Caption & "','" & lblLantai.Caption & "','" & lblFasilitas.Caption & "','" & lblTarif.Caption & "')")
Else
If MsgBox("data ini sudah ada dalam database," & " perbaiki?", vbQuestion + vbYesNo, "konfirmasi") Then
dbhotel.Execute "update tbkamar set jeniskamar ='" & lbljeniskamar.Caption & "', lantai='" & lblLantai.Caption & "',fasilitas= '" & lblFasilitas.Caption & "', tarif= '" & lblTarif.Caption & "' where nokamar= '" & cbonokamar.Text & "'"
End If
End If
bersih
End Sub


Private Sub Form_Load()
bersih
Adodc1.ConnectionString = constring
Adodc1.username = username
Adodc1.Password = passworduser
Adodc1.RecordSource = "select * from tbkamar"

cbonokamar.AddItem "1"
cbonokamar.AddItem "2"
cbonokamar.AddItem "3"
cbonokamar.AddItem "4"
cbonokamar.AddItem "5"
cbonokamar.AddItem "6"
cbonokamar.AddItem "7"
cbonokamar.AddItem "8"
cbonokamar.AddItem "9"
cbonokamar.AddItem "10"
cbonokamar.AddItem "11"
cbonokamar.AddItem "12"
cbonokamar.AddItem "13"
cbonokamar.AddItem "14"
cbonokamar.AddItem "15"
cbonokamar.AddItem "16"
cbonokamar.AddItem "17"
cbonokamar.AddItem "18"
cbonokamar.AddItem "19"
cbonokamar.AddItem "20"
cbonokamar.AddItem "21"
End Sub

Private Sub bersih()
cbonokamar.Text = ""
lblKamar.Caption = ""
lblLantai.Caption = ""
lblFasilitas.Caption = ""
lblTarif.Caption = ""
End Sub

Private Sub cmdbersih_Click()
bersih
End Sub




Private Sub cbokodejasa_Click()
If cbokodejasa.Text = "L-1kgr" Then
txtnamajasa.Text = "Laundry"
txtsatuan.Text = "Per Kilo Gram"
txtharga.Text = "Rp. " & "5000"
ElseIf cbokodejasa.Text = "S-1org" Then
txtnamajasa.Text = "Free Salon"
txtsatuan.Text = "Per Orang"
txtharga.Text = "Rp. " & "10000"
ElseIf cbokodejasa.Text = "P-1jam" Then
txtnamajasa.Text = "Play Station"
txtsatuan.Text = "Per Jam"
txtharga.Text = "Rp. " & "10000"
ElseIf cbokodejasa.Text = "P-1rl" Then
txtnamajasa.Text = "Pijat Relaksasi"
txtsatuan.Text = "Per Orang"
txtharga.Text = "Rp. " & "100000"
ElseIf cbokodejasa.Text = "K-1mnt" Then
txtnamajasa.Text = "Karaoke"
txtsatuan.Text = "Per Jam"
txtharga.Text = "Rp. " & "70000"
ElseIf cbokodejasa.Text = "S-2org" Then
txtnamajasa.Text = "Swimming Pool"
txtsatuan.Text = "Per Orang"
txtharga.Text = "Rp. " & "15000"
End If
End Sub

Private Sub cmdbersih_Click()
cbokodejasa.SetFocus
bersih
End Sub

Private Sub cmdtutup_Click()
PSN = MsgBox("ANDA YAKIN MAU KELUAR?", vbQuestion + vbYesNo, "PESAN")
If PSN = vbYes Then
Unload Me
End If
End Sub

Private Sub CMDHAPUS_Click()
Dim dbhotel As New ADODB.Connection
Dim rstbjasa As ADODB.Recordset
dbhotel.Open constring, username, passworduser
dbhotel.Execute "Delete from tbjasa where kodejasa ='" & cbokodejasa.Text & "'"
bersih
End Sub

Private Sub cmdsimpan_Click()
Dim dbhotel As New ADODB.Connection
Dim rstbjasa As ADODB.Recordset
dbhotel.Open constring, username, passworduser
Set rstbjasa = dbhotel.Execute("select * from tbjasa where kodejasa ='" & cbokodejasa.Text & "'")
If rstbjasa.EOF Then
dbhotel.Execute ("insert into tbjasa(kodejasa, namajasa, satuan, harga) values ('" & cbokodejasa.Text & "','" & txtnamajasa.Text & "','" & txtsatuan.Text & "','" & txtharga.Text & "')")
Else
If MsgBox("data ini sudah ada dalam database," & " perbaiki?", vbQuestion + vbYesNo, "konfirmasi") Then
dbhotel.Execute "update tbjasa set namajasa ='" & txtnamajasa.Text & "', satuan='" & txtsatuan.Text & "',harga= '" & txtharga.Text & "' where kodejasa= '" & cbokodejasa.Text & "'"
End If
bersih
cbokodejasa.SetFocus
End If
 End Sub
Private Sub Form_Load()
bersih
Adodc1.ConnectionString = constring
Adodc1.username = username
Adodc1.Password = passworduser
Adodc1.RecordSource = "select * from tbjasas"

cbokodejasa.AddItem "L-1kgr"
cbokodejasa.AddItem "S-1org"
cbokodejasa.AddItem "P-1jam"
cbokodejasa.AddItem "P-1rl"
cbokodejasa.AddItem "K-1mnt"
cbokodejasa.AddItem "S-2org"
cbokodejasa.AddItem "L-1kgr"
bersih
End Sub
Private Sub bersih()
cbokodejasa.Text = ""
txtnamajasa.Text = ""
txtsatuan.Text = ""
txtharga.Text = ""
End Sub

Private Sub txtnamajasa_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtsatuan.SetFocus
End If
End Sub

Private Sub txtsatuan_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtharga.SetFocus
End If
End Sub





ttd:
yany








Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s

%d blogger menyukai ini: