Join 2 Tabel August 30, 2007
Posted by mulyono rafianto in Programming.trackback
Membuat Grup Join 2 tabel pada Visual Foxpro, dimana master file mastgrp.dbf akan di respon oleh penambahan data field dari fmoutlet.dbf, lihat gambar. Membantu pada Join beberapa table. … semoga logic ini membantu, dalam mengembangkan aplikasi visual foxpro anda…..
- DEFINE CLASS GroupM1LoadObj AS FORM
- autocenter = .T. && display at center of the screen
- width = 700
- height = 610
- borderstyle = 0 && no border (unsizeable)
- caption = ‘Master Grouping Customer Listing’
- movable = .F.
- closable = .T.
- desktop = .T.
- maxbutton = .F. && Disable Maximize Button on the upper right corner
- minbutton = .F.
- showwindow = 1 && In Top Level Form
- windowtype = 1 && modal
- scrollbars = 3 && scroll horz and vert
- showtips = .T. && This property will effect controls to show the tooltiptext if available
- icon = ‘print.ico’
- ADD OBJECT text1_Judul AS LABEL;
- WITH;
- alignment = 0,;
- top = 5,;
- left = 10,;
- width = 400,;
- height = 30,;
- caption = ‘Maintenance Master Grouping Listing Cusmomer’,;
- fontname = ‘Arial’,;
- fontsize = 10,;
- fontbold = .T.
- ADD OBJECT layar_grid AS layar_gridObj
- *** Control Button ***
- ADD OBJECT printGB AS COMMANDGROUP;
- WITH;
- top = 560,;
- left = 10,;
- width = 200,;
- height = 47,;
- borderstyle = 0
- *** End of Control Button ***
- PROCEDURE printGB.init()
- this.addobject(‘insert’,'insertbuttonobj’)
- this.addobject(‘delete’,'deletebuttonobj’)
- ENDPROC
- ENDDEFINE
- DEFINE CLASS insertbuttonobj AS COMMANDBUTTON
- caption = ‘\<Insert’
- top = 0
- left = 0
- width = 60
- height = 23
- fontname = ‘Arial’
- fontsize = 8
- fontbold = .T.
- tooltiptext = ‘Insert Group Product…’
- mousepointer = 99
- mouseicon = ‘H_point.cur’
- visible = .T.
- PROCEDURE click()
- a = RECNO()
- APPEND BLANK
- GO top
- this.Parent.parent.layar_grid.refresh
- ENDPROC
- ENDDEFINE
- DEFINE CLASS deletebuttonobj AS COMMANDBUTTON
- caption = ‘\<Delete’
- top = 0
- left = 65
- width = 60
- height = 23
- fontname = ‘Arial’
- fontsize = 8
- fontbold = .T.
- tooltiptext = ‘Delete Group Product…’
- mousepointer = 99
- mouseicon = ‘H_point.cur’
- visible = .T.
- PROCEDURE click()
- a = RECNO()
- DELETE NEXT 1
- GO top
- this.Parent.parent.layar_grid.refresh
- ENDPROC
- ENDDEFINE
- DEFINE CLASS layar_gridObj AS GRID
- top = 55
- left = 10
- width = 680
- height = 488
- columncount = 0 && start setting the columncount property with 0
- allowaddnew = .F. && disallow adding new record to the table
- allowheadersizing = .F. && disallow resizing the header at run time
- allowrowsizing = .F. && disallow resizing the row size at run time
- headerheight = 18
- rowheight = 18
- scrollbars = 2 && Vertical only
- recordmark = .F. && hide record mark column on the grid
- deletemark = .F. && hide delete mark column on the grid
- recordsourcetype = 1 && Use Alias to specified the table
- recordsource = ‘mastgrp’ && Alias name : ‘detfile1′
- *** Init Event ***
- PROCEDURE init
- this.addobject(‘column1′,’gridcolumn1′)
- WITH this.column1
- .controlsource = ‘mastgrp.grouping’
- .forecolor = RGB(0,0,255)
- .width = 300
- .alignment = 0
- .readonly = .F.
- .enabled = .T. && enabled the column to get focus
- WITH .header1
- .caption = ‘Master Grouping’
- .alignment = 2
- .forecolor = RGB(0,0,255)
- .fontname = ‘Arial’
- .fontsize = 8
- .fontbold = .T.
- ENDWITH
- ENDWITH
- this.addobject(‘column2′,’gridcolumn1′)
- WITH this.column2
- .controlsource = ‘mastgrp.outletid’
- .forecolor = RGB(0,0,255)
- .width = 50
- .alignment = 0
- .readonly = .F.
- .enabled = .T. && enabled the column to get focus
- WITH .header1
- .caption = ‘ID.Otlet’
- .alignment = 2
- .forecolor = RGB(0,0,255)
- .fontname = ‘Arial’
- .fontsize = 8
- .fontbold = .T.
- ENDWITH
- ENDWITH
- this.addobject(‘column3′,’gridcolumnSIOutlet’)
- WITH this.column3
- .controlsource = ‘mastgrp.nama_outle’
- .forecolor = RGB(0,0,255)
- .width = 180
- .alignment = 0
- .readonly = .F.
- .enabled = .T. && enabled the column to get focus
- WITH .header1
- .caption = ‘Softex_Outlet’
- .alignment = 2
- .forecolor = RGB(0,0,255)
- .fontname = ‘Arial’
- .fontsize = 8
- .fontbold = .T.
- ENDWITH
- ENDWITH
- ENDPROC
- ENDDEFINE
- DEFINE CLASS gridcolumn1 AS COLUMN
- bound = .T.
- resizable = .F. && disabled to resize the column by user at run time
- fontname = ‘Arial’
- fontsize = 8
- fontbold = .F.
- selectonentry = .T. && the whole text Selected when the column gotfocus
- visible = .T.
- ADD OBJECT text1 AS TEXTBOX
- PROCEDURE text1.init
- this.margin = 0
- this.borderstyle = 0
- this.fontname = this.parent.fontname
- this.fontsize = this.parent.fontsize
- this.fontbold = this.parent.fontbold
- ENDPROC
- ENDDEFINE
- DEFINE CLASS gridcolumnSIOutlet AS COLUMN
- bound = .T.
- resizable = .F. && disabled to resize the column by user at run time
- fontname = ‘Arial’
- fontsize = 8
- fontbold = .F.
- selectonentry = .T. && the whole text Selected when the column gotfocus
- visible = .T.
- ADD OBJECT text1 AS COMBOBOX
- PROCEDURE text1.init()
- this.margin = 0
- this.borderstyle = 0
- this.fontname = this.parent.fontname
- this.fontsize = this.parent.fontsize
- this.fontbold = this.parent.fontbold
- SELECT fmoutlet
- GO top
- DO WHILE !EOF()
- this.additem(fmoutlet.nama_outle)
- SELECT fmoutlet
- skip
- ENDDO
- ENDPROC
ENDDEFINE


Comments»
No comments yet — be the first.