Oleh: admin | 22/11/2011

Praktikum Lanjutan Visual Foxpro 9

Buat Madyasiswa Program Pendidikan Komputer 1 Tahun Jurusan Komputer Programming agar mengerjakan Latihan berikut ini :

Buat Tabel dengan nama : tblpenduduk

Rancang Form dan beri nama : frmpenduduk

Lengkapi Listing dibawah ini :

Object Frmpenduduk Procedure Init

SET TALK OFF
SET DELETE on
SET EXCLUSIVE on
SET EXACT ON
IF !USED("tbl…………………………")
SELECT 1 
USE tbl………………………… EXCLUSIVE
ENDIF
thisform. ……………………………………………….value =''
thisform. ……………………………………………….Value =''
thisform. ……………………………………………….Value =''  
thisform. ……………………………………………….Value =''
thisform. ……………………………………………….Value =''  
thisform. ……………………………………………….Enabled = .F. 
thisform. ……………………………………………….Enabled = .F.  
thisform. ……………………………………………….Enabled = .F. 
thisform. ……………………………………………….Enabled = .F. 
thisform.cmdsimpan.Enabled = .F.
thisform.cmdedit.Enabled = .F. 
thisform.cmdhapus.Enabled = .F.     
thisform. ……………………………………………….SetFocus
 

Object Frmpenduduk Procedure Load

PUBLIC baru
baru =0
 

Object txtnik Procedure Lostfocus

IF EMPTY(this.Value)
this.SetFocus
RETURN
ENDIF
SELECT tbl
SET ORDER TO tag ………………………
LOCATE FOR ………………=this.Value
IF FOUND()
 thisform. ……………………………………………….Value =…………………………
 thisform. ……………………………………………….Value =…………………………
 thisform. ……………………………………………….Value =…………………………
 thisform. ……………………………………………….Value =…………………………
 thisform.cmdedit.Enabled= .T.
 thisform.cmdhapus.Enabled=.t.    
 baru=1
 ELSE
 thisform. ……………………………………………….Enabled = .T. 
 thisform. ……………………………………………….Enabled = .T.   
 thisform. ……………………………………………….Enabled = .T. 
 thisform. ……………………………………………….Enabled = .T.   
 thisform. ……………………………………………….SetFocus
 baru=0
 thisform.cmdsimpan.Enabled=.t.
 ENDIF
 

Object cmdsimpan Procedure Click

IF EMPTY(thisform. ……………………………………………….Value)
   =MESSAGEBOX("………………………………………………belum diisi",0+64,"Info")
   RETURN
ENDIF
IF EMPTY(thisform. ……………………………………………….Value)
   =MESSAGEBOX("…………………………belum diisi",0+64,"Info")
   RETURN
ENDIF
IF EMPTY(thisform. ……………………………………………….Value)
   =MESSAGEBOX("………………………… belum diisi",0+64,"Info")
   RETURN
ENDIF
IF EMPTY(thisform. ……………………………………………….Value)
   =MESSAGEBOX("………………………… belum diisi",0+64,"Info")
   RETURN
ENDIF
IF EMPTY(thisform. ……………………………………………….Value)
   =MESSAGEBOX("………………………… belum diisi",0+64,"Info")
   RETURN
ENDIF
SELECT tbl…………………………
SET ORDER To tag …………………………
…………………………=ALLTRIM(thisform. ……………………………………………….Value)
…………………………=ALLTRIM(thisform. ……………………………………………….Value)
…………………………=ALLTRIM(thisform. ……………………………………………….Value)
…………………………=ALLTRIM(thisform. ……………………………………………….Value)
…………………………=ALLTRIM(thisform. ……………………………………………….Value)

IF baru=0
  INSERT INTO tbl………………………… (…………………………,…………………………,…………………………,
   …………………………,………………………… ) values(…………………………,…………………………,…………………………,
   …………………………,………………………… )
  ELSE
  UPDATE tbl………………………… set …………………………=…………………………,…………………………=…………………………,    
  …………………………=…………………………,…………………………=…………………………
  WHERE …………………………=…………………………
  ENDIF
  thisform.cmdbatal.Click

 

Object cmdedit procedure click

this.Enabled = .F. 
thisform.cmdsimpan.Enabled = .T.  
baru = 1
thisform. ……………………………………………….Enabled = .F. 
thisform. ……………………………………………….Enabled = .T. 
thisform. ……………………………………………….Enabled = .T. 
thisform. ……………………………………………….Enabled = .T. 
thisform. ……………………………………………….Enabled = .T. 
thisform. ……………………………………………….SetFocus
 

Object cmdhapus procedure click

IF MESSAGEBOX("Data ini mau dihapus?",4+32,"Konfirmasi")=7
thisform.cmdbatal.Click
return
ENDIF
SELECT tbl…………………………
SET ORDER TO tag …………………………
DELETE
thisform.cmdbatal.Click
 

Object cmdbatal procedure click

thisform. ……………………………………………….value =''
thisform. ……………………………………………….Value =''
thisform. ……………………………………………….Value =''  
thisform. ……………………………………………….Value =''
thisform. ……………………………………………….Value =''  
thisform. ……………………………………………….Enabled = .F. 
thisform. ……………………………………………….Enabled = .F.  
thisform. ……………………………………………….Enabled = .F. 
thisform. ……………………………………………….Enabled = .F. 
thisform.cmdsimpan.Enabled = .F.
thisform.cmdedit.Enabled = .F. 
thisform.cmdhapus.Enabled = .F.    
thisform.Refresh
thisform. ……………………………………………….Enabled = .T.  
thisform. ……………………………………………….SetFocus

Selamat Bekerja, Semoga Sukses


Responses

  1. terima kasih atas tutorialnya dan scriptnya semoga website ini semakin maju,
    wildan08.wordpress.com syaifullahamikom.web.id

  2. ada sistem informasi perpustakaan gak ya??

    • ada.


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 )

Foto Google+

You are commenting using your Google+ 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 )

Connecting to %s

Kategori

%d blogger menyukai ini: