Sub Nonaktif( )
txtkode.enabled= false
txtnama.enabled=false
txtharga.enabled=false
end sub
Sub aktif ( )
txtkode.enabled=true
txtnama.enabled=true
txtgharga.enabled=true
End Sub
Sub bersih ( )
txtkode=""
txtnama=""
txtharga=""
End Sub
Private Sub cmdadd_Click( )
aktif
data1.recordset.addnew
txtkode.setFocus
End Sub
Private Sub cmdcancel_Click()
nonaktif
data1.recordset.cancelUpdate
data1.recordset.Movelast
End Sub
Private sub cmdclose_Click()
x=Msgbox("Yakin Mo Keluar?",32+4,"Info")
if x =6 Then
Unload me
End Sub
Private Sub cmddelete
x=msgBox("Yakin Mo dihapus?",32+4,"Info")
if x= 6 Then
data1.recordset.delete
endif
data1.refresh
End Sub
Private Sub cmdedit
aktif
txtkode.enabled=false
data1.recordset.edit
End Sub
Private Sub cmdfirst
data1.recordset.moveFirst
End Sub
Private Sub cmdlast
data1.recordset.moveLast
end Sub
Private Sub cmdnext
data1.recordset.movenext
if data1.recordset.EOF then
data1.recordset.movelast
Msgbox"data di akhir",16,"Info"
endif
End Sub
cmdprev
data1.recordset.moveprevious
if data1.recordset.BOF Then
data1.recordset.movelast
msgbox"Data di Awal",16,"info"
endif
end sub
Private SUB CMDSAVE
Msgbox "data tersimpan",16,"info"
data1.recordset.update
data1.recordset.movelast
End sub
private sub form load()
nonaktif
end sub
txtkode.enabled= false
txtnama.enabled=false
txtharga.enabled=false
end sub
Sub aktif ( )
txtkode.enabled=true
txtnama.enabled=true
txtgharga.enabled=true
End Sub
Sub bersih ( )
txtkode=""
txtnama=""
txtharga=""
End Sub
Private Sub cmdadd_Click( )
aktif
data1.recordset.addnew
txtkode.setFocus
End Sub
Private Sub cmdcancel_Click()
nonaktif
data1.recordset.cancelUpdate
data1.recordset.Movelast
End Sub
Private sub cmdclose_Click()
x=Msgbox("Yakin Mo Keluar?",32+4,"Info")
if x =6 Then
Unload me
End Sub
Private Sub cmddelete
x=msgBox("Yakin Mo dihapus?",32+4,"Info")
if x= 6 Then
data1.recordset.delete
endif
data1.refresh
End Sub
Private Sub cmdedit
aktif
txtkode.enabled=false
data1.recordset.edit
End Sub
Private Sub cmdfirst
data1.recordset.moveFirst
End Sub
Private Sub cmdlast
data1.recordset.moveLast
end Sub
Private Sub cmdnext
data1.recordset.movenext
if data1.recordset.EOF then
data1.recordset.movelast
Msgbox"data di akhir",16,"Info"
endif
End Sub
cmdprev
data1.recordset.moveprevious
if data1.recordset.BOF Then
data1.recordset.movelast
msgbox"Data di Awal",16,"info"
endif
end sub
Private SUB CMDSAVE
Msgbox "data tersimpan",16,"info"
data1.recordset.update
data1.recordset.movelast
End sub
private sub form load()
nonaktif
end sub
Komentar
Posting Komentar