New database, new table
Untuk tombol selesai
IF thisform.commandgroup1.command3.Caption="selesai"
IF MESSAGEBOX("Sudah selesai...?",4+32,"konfirmasi")=6
thisform.release
ENDIF
ELSE
IF thisform.commandgroup1.command3.Caption="koreksi"
thisform.commandgroup1.command3.Caption="simpan"
thisform.text2.Enabled=.T.
thisform.text2.SetFocus()
ELSE
thisform.commandgroup1.command3.Caption="selesai"
thisform.tombolnormal
thisform.obyekmati
thisform.simpandata
WAIT window("Data Koreksi Telah Disimpan")
thisform.commandgroup1.command1.SetFocus
ENDIF
ENDIF
Untuk simpan data
thisform.commandgroup1.command1.Caption="tambah"
APPEND BLANK
thisform.simpandata
WAIT WINDOW ("Data sudah tersimpan")
thisform.obyekmati
thisform.tombolnormal
replace kd_jabatan WITH thisform.text1.Value
replace nm_jabatan WITH thisform.text2.Value
untuk cari dan sebagainya di text1
IF thisform.commandgroup1.command1.Caption="simpan"
IF EMPTY(thisform.text1.value)
IF MESSAGEBOX("Tidak Jadi Tambah...?",4+32,"konfirmasi")=6
thisform.obyekmati
thisform.tombolnormal
thisform.commandgroup1.command1.setfocus
ENDIF
ELSE
IF SEEK(thisform.text1.Value)
MESSAGEBOX("kode tersebut sudah ada",16,"peringatan")
thisform.text1.Value=kd_jabatan
thisform.text2.Value=nm_jabatan
thisform.obyekmati
thisform.tombolnormal
thisform.commandgroup1.command1.setfocus
ENDIF
ENDIF
ELSE
IF thisform.commandgroup1.command2.Caption="batal"
IF EMPTY(thisform.text1.value)
IF MESSAGEBOX("Tidak Jadi Cari...?",4+32,"konfirmasi")=6
thisform.obyekmati
thisform.tombolnormal
thisform.commandgroup1.command1.setfocus
ENDIF
ELSE
IF SEEK(thisform.text1.Value)
thisform.text1.Value=kd_jabatan
thisform.text2.Value=nm_jabatan
thisform.obyekmati
thisform.commandgroup1.command1.Enabled= .t.
thisform.commandgroup1.command3.Enabled= .t.
thisform.commandgroup1.command1.caption= "hapus"
thisform.commandgroup1.command3.caption= "koreksi"
ELSE
MESSAGEBOX("kode tersebut tidak ada",16,"peringatan")
thisform.obyekmati
thisform.tombolnormal
thisform.commandgroup1.command1.setfocus
ENDIF
ENDIF
ENDIF
ENDIF
untuk transaksi di form , load
SELECT a
USE tpegawai
SET ORDER TO nik
SELECT b
USE tjabatan
SET ORDER TO kd_jabatan
SELECT c
USE ttransjabatan
SET ORDER TO nik
Replace
SELECT ttransjabatan
APPEND BLANK
replace ttransjabatan.nik WITH thisform.text1.value
replace ttransjabatan.kd_jabatan WITH thisform.combo1.value
replace ttransjabatan.tgl_hbs_masa_jabatan WITH thisform.text5.value
WAIT Window("Data Sudah Tersimpan")
Home »Unlabelled » Koding foxpro
{ 0 komentar... Views All / Send Comment! }
Posting Komentar