Selasa, 31 Januari 2012



Koding form pada Program Foxpro
Init
THISFORM.TIdakaktif

Load
CLOSE DATABASES
SET DEFAULT TO D:\LATIHANBARANG
USE TABLEBARANG
SET ORDER TO KODEBRG   && KODEBRG
THISFORM.Refresh

Unload
CLOSE INDEXES
CLOSE DATABASES
IF USED("TABLEBARANG")
USE
ENDIF
THISFORM.Release

Aktif
thisform.text1.Enabled= .T.
thisform.text2.Enabled= .T.
thisform.text3.Enabled= .T.
thisform.text4.Enabled= .T.
thisform.text5.Enabled= .T.
thisform.text6.Enabled= .T.
thisform.text6.Value=CTOD("")
thisform.text3.Value=0
thisform.text5.Value=0
thisform.text1.MaxLength=4
thisform.cmdsimpan.Enabled= .T.
thisform.cmdcancel.Enabled= .T.

bersih
thisform.text1.Value=""
thisform.text2.Value=""
thisform.text3.Value=0
thisform.text4.Value=""
thisform.text5.Value=0
thisform.text6.Value=CTOD("")
thisform.text6.SetFocus

tidak bersih
THISFORM.Text1.Enabled= .F.
THISFORM.Text2.Enabled= .F.
THISFORM.Text3.Enabled= .F.
THISFORM.Text4.Enabled= .F.
THISFORM.Text5.Enabled= .F.
THISFORM.Text6.Enabled= .F.
THISFORM.cmdsimpan.Enabled= .F.
THISFORM.cmdcancel.Enabled= .F.


search
IF NOT EMPTY(thisform.text7.Value)
LOCATE for (thisform.text7.Value)
IF FOUND()

MESSAGEBOX ("Data di Temukan")
thisform.text1.Value=kodebrg
thisform.text2.Value=namabrg
thisform.text3.Value=harga
thisform.text4.Value=satuan
thisform.text5.Value=stock
thisform.text6.Value=tglpl
thisform.text1.Refresh
thisform.text7.SetFocus
thisform.text7.Value=""
thisform.tidakaktif
ELSE
MESSAGEBOX ("Data tidak di Temukan")
thisform.text7.SetFocus
thisform.text7.Value=""
thisform.bersih
ENDIF

thisform.cmdsimpan.Enabled= .T.
thisform.cmdcancel.Enabled= .T.
thisform.cmdadd.Enabled= .T.
ELSE
MESSAGEBOX("Kode Belum di Isi")
ENDIF


Kodingnya :
GO TOP
THISFORM.TEXT1.Value=kodebrg
THISFORM.TEXT2.Value=namabrg
THISFORM.TExt3.Value=harga
Thisform.text4.Value=satuan
thisform.text5.Value=stock
thisform.text6.Value=tglpl

MESSAGEBOX("anda sudah berada di record awal")

Kodingnya :
SKIP -1
IF BOF()
GO TOP
MESSAGEBOX("anda sudah berada di record awal")
ENDIF

thisform.text1.Value=kodebrg
thisform.text2.Value=namabrg
thisform.text3.Value=harga
thisform.text4.Value=satuan
thisform.text5.Value=stock
thisform.text6.Value=tglpl

Kodingnya :
SKIP
thisform.text1.Value=kodebrg
thisform.text2.Value=namabrg
thisform.text3.Value=harga
thisform.text1.Value=satuan
thisform.text1.Value=stock
thisform.text1.Value=tglpl

Kodingnya :
GO BOTTOM
thisform.text1.Value=kodebrg
thisform.text2.Value=namabrg
thisform.text3.Value=harga
thisform.text4.Value=satuan
thisform.text5.Value=stock
thisform.text6.Value=tglpl

MESSAGEBOX("anda sudah berada pada record akhir")



Add :
THISFORM.AKtif
THISFORM.Text6.SetFocus
THISFORM.Command1.Enabled= .F.

Save :
JAWAB=MESSAGEBOX("Are You Sure",4+64,"Information")
IF jawab=6

APPEND BLANK

REPLACE KODEBRG WITH THISFORM.Text1.Value

REPLACE NAMABRG WITH THISFORM.Text2.Value

REPLACE HARGA WITH THISFORM.Text3.Value

REPLACE SATUAN WITH THISFORM.Text4.Value

REPLACE STOCK WITH THISFORM.Text5.Value

REPLACE TGLPL WITH THISFORM.Text6.Value

THISFORM.BErsih

ENDIF


Delete :
Masih kosong ………………………………………….. *_^



Preview :
BROWSE

Cancel :
THISFORM.Bersih

Exit :
THISFORM.Release


Tidak ada komentar:

Posting Komentar