Subject Re: order by on different way
From Dirk <non@non.com>
Date Wed, 17 Nov 2021 16:53:20 +0100
Newsgroups dbase.getting-started
Attachment(s) stammcust..txt

Op 17/11/2021 om 14:39 schreef Mervyn Bick:
> On 2021/11/17 06:58, Dirk wrote:
>
>> thank you for the point of view, i just renew a form with several
>> filters and these i want to replace with param. the form itself can
>> create basic info as name and so, even filter on place postcode
>> modifying the add function to a separate form to add new info will help.
>>
>> something else : what's your opnion about datalink, i know it's make
>> live easier, but is using the field value not better ?
>
> Dirk, this is difficult to comment on without a fuller picture of what
> you have and what you want to get out of it.
>
> Using a rowset's filter property to limit the records on view in an
> existing rowset is very convenient.  The filter string can be one of
> several pre-set options or it can be put together "on the fly" if
> necessary so one can allow the user to choose fields and the criteria
> for each field.  Once the filter string has been built in memory it can
> be applied and the response is immediate.
>
> Unfortunately a filter can only use the standard comparison operators.
> Predicates such as BETWEEN, IS NULL, IS NOT NULL and LIKE are not
> supported.
>
> A parameter driven query gives one more power but it does need to be set
> up up front.  Changing the SQL statement and parameters "on the fly" can
> be done but it's not something to be undertaken lightly.
>
> Building a new SQL statement for a standard query is straightforward but
> it can necessitate restating all the datalinks associated with the rowset.
>
> In the end you will have to decide for yourself which route to follow.
>
> Using datalinks can greatly simplify code.  Inadvertent navigation in
> the rowset can, however, result in changes being saved unexpectedly.  On
> the other hand, using an onNavigate event handler to populate controls
> needs more work but nothing gets saved unless you want it saved.
>
> Nowadays I use Firebird for all my own data.  All queries for fetching
> data for display are read-only.  Datalinked controls can, therefore, not
> be used for editing.
>
> Mervyn.
>
>
>
>
>
Mervyn

that's how i do nowadays, i want to modify to by order and parameters
for searching

the stammdat.dbf has 6 indexes and want to work with only one on idnummer,

if i eliminate the others wil have to modify the whole programm
structure :)


the programm on it works correct but ok, form me when it can be
difficult i do

Dirk










** END HEADER -- do not remove this line
//
// Generated on 05/10/2021
//
parameter bModal
local f
f = new StammcustForm()
if (bModal)
   f.mdi = false // ensure not MDI
   f.readModal()
else
   f.open()
endif

class StammcustForm of FORM
   with (this)
      onGotFocus = class::FORM_ONGOTFOCUS
      onLostFocus = class::FORM_ONLOSTFOCUS
      onNavigate = class::FORM_ONNAVIGATE
      canClose = class::FORM_CANCLOSE
      canNavigate = class::FORM_CANNAVIGATE
      onOpen = class::FORM_ONOPEN
      onClose = class::FORM_ONCLOSE
      open = class::FORM_OPEN
      readModal = class::FORM_READMODAL
      scaleFontSize = 10.0
      scaleFontBold = true
      metric = 6        // Pixels
      colorNormal = "0x787878"
      height = 638.0
      left = 199.0
      top = 30.0
      width = 731.0
      text = "firma adressen ****Bci**** "
      autoCenter = true
      mdi = true
      showTaskBarButton = true
      smallTitle = true
      sizeable = false
      moveable = true
      statusMessage = ""
      menuFile = "bci2.mnu"
      icon = "filename D:\DFCC_Programms\Customerinfo\include\dfccinfo.ico"
   endwith

   this.DATABANK_KLANTEN = new DATABASE(this)
   with (this.DATABANK_KLANTEN)
      left = 19.0
      top = 135.0
      width = 96.0
      height = 37.0
      databaseName = "CUSTINFO"
      active = true
   endwith

   this.VRaagBak_FIRMA = new QUERY(this)
   with (this.VRaagbak_FIRMA)
      left = 35.0
      top = 77.0
      width = 53.0
      height = 37.0
      database = form.databank_klanten
      sql = [Select idnummer, name, street, plz, city, province,areacode, country, basetelefon, basefax, handy,;
                email, web, soort, choice, creatie,;
                 outside, taal, monitor, btwnummer, btw, betalingen from "stammdat"]
      active = true
   endwith

   with (this.VRaagbak_FIRMA.rowset)
      with (fields["Province"])
         lookupSQL = "select areacode,area from euroregions order by area"
      endwith
      with (fields["Country"])
         lookupSQL = "select landId,land from country order by land"
      endwith
      with (fields["soort"])
         lookupSQL = "select segcode,description from segm order by description"
      endwith
      with (fields["outside"])
         lookupSQL = [select * from employee order by name]
      endwith
      with (fields["TAAL"])
         lookupSQL = [select idtaal,naam from taal order by naam]
      endwith
      autoEdit = false
   endwith

   this.VRaagbak_BEDRIJFSTAK = new QUERY(this)
   with (this.VRaagbak_BEDRIJFSTAK)
      left = 301.0
      top = 99.0
      width = 87.0
      height = 37.0
      database = form.databank_klanten
      sql = 'Select * from "branches"'
      active = true
   endwith

   this.VRaagbak_SEGM = new QUERY(this)
   with (this.VRaagbak_SEGM)
      left = 259.0
      top = 33.0
      width = 50.0
      height = 37.0
      database = form.databank_klanten
      sql = [Select segm.segcode,segm.description from "segm.dbf" segm]
      active = true
   endwith

   with (this.VRaagbak_SEGM.rowset)
      autoEdit = false
      indexName = "segcode"
   endwith

   this.vraagbak_BEDIEND = new QUERY(this)
   with (this.vraagbak_BEDIEND)
      left = 539.0
      top = 237.0
      width = 66.0
      height = 37.0
      database = form.databank_klanten
      sql = 'Select * from "employee"'
      active = true
   endwith

   with (this.vraagbak_BEDIEND.rowset)
      autoEdit = false
   endwith

   this.vraagbak_REGIO = new QUERY(this)
   with (this.vraagbak_REGIO)
      left = 231.0
      top = 239.0
      width = 54.0
      height = 37.0
      database = form.databank_klanten
      sql = 'Select landcode, areacode,area from "euroregions"'
      active = true
   endwith

   with (this.vraagbak_REGIO.rowset)
      autoEdit = false
   endwith

   this.vraagbak_KONTAKT = new QUERY(this)
   with (this.vraagbak_KONTAKT)
      onOpen = class::vraagbak_KONTAKT_ONOPEN
      left = 399.0
      top = 66.0
      width = 66.0
      height = 37.0
      database = form.databank_klanten
      sql = 'Select * from "communicate"'
      active = true
   endwith

   with (this.vraagbak_KONTAKT.rowset)
      with (fields["task"])
         lookupSQL = "select * from job"
      endwith
      with (fields["Voor_en_naam"])
         beforeGetValue = class::VOOR_EN_NAAM_BEFOREGETVALUE
      endwith
      autoEdit = false
      masterRowset = form.vraagbak_firma.rowset
      masterFields = "IDNUMMER"
   endwith

   this.TEKST_HOOFDING = new TEXT(this)
   with (this.TEKST_HOOFDING)
      height = 22.0
      left = 10.0
      top = 5.0
      width = 221.0
      colorNormal = "blue/0x787878"
      fontName = "Times New Roman"
      fontSize = 14.0
      fontBold = true
      text = ""
   endwith

   this.RECHTHOEK_EIGENSCHAPPEN = new RECTANGLE(this)
   with (this.RECHTHOEK_EIGENSCHAPPEN)
      left = 5.0
      top = 330.0
      width = 630.0
      height = 63.0
      text = ""
      colorNormal = "white/0x8d8d8d"
      border = false
      borderStyle = 2        // Lowered
   endwith

   this.RECHTHOEK_BLADWIJZER = new RECTANGLE(this)
   with (this.RECHTHOEK_BLADWIJZER)
      left = 5.0
      top = 495.0
      width = 715.0
      height = 135.0
      text = "Firma    Contact"
      colorNormal = "white/0x8d8d8d"
      fontBold = true
   endwith

   this.RECHTHOEK_COMMUNICATIE = new RECTANGLE(this)
   with (this.RECHTHOEK_COMMUNICATIE)
      left = 5.0
      top = 225.0
      width = 630.0
      height = 100.0
      text = ""
      colorNormal = "white/0x8d8d8d"
      border = false
      borderStyle = 2        // Lowered
   endwith

   this.RECHTHOEK_BASISDATA = new RECTANGLE(this)
   with (this.RECHTHOEK_BASISDATA)
      left = 5.0
      top = 66.0
      width = 630.0
      height = 121.0
      text = ""
      colorNormal = "white/0x8d8d8d"
      border = false
      borderStyle = 2        // Lowered
   endwith

   this.RECHTHOEK_KONTAKTEN = new RECTANGLE(this)
   with (this.RECHTHOEK_KONTAKTEN)
      left = 640.0
      top = 70.0
      width = 83.0
      height = 60.0
      text = "contact"
      colorNormal = "BtnText/0x8d8d8d"
      fontBold = true
   endwith

   this.VELD_IDNR = new ENTRYFIELD(this)
   with (this.VELD_IDNR)
      when = class::VELD_IDNR_WHEN
      dataLink = form.vraagbak_firma.rowset.fields["idnummer"]
      height = 15.0
      left = 88.0
      top = 74.0
      width = 84.0
      colorNormal = "black/silver"
      border = false
      tabStop = false
      fontBold = true
      borderStyle = 3        // None
   endwith

   this.TEKST_FIRMA = new TEXT(this)
   with (this.TEKST_FIRMA)
      height = 16.0
      left = 10.0
      top = 96.0
      width = 61.0
      wrap = false
      colorNormal = "BtnText/0x8d8d8d"
      alignVertical = 1        // Middle
      fontBold = true
      text = "firma"
   endwith

   this.VELD_NAAM = new ENTRYFIELD(this)
   with (this.VELD_NAAM)
      dataLink = form.vraagbak_firma.rowset.fields["name"]
      systemTheme = false
      height = 15.0
      left = 88.0
      top = 96.0
      width = 538.0
      colorNormal = "black/silver"
      border = false
      fontBold = true
      borderStyle = 3        // None
   endwith

   this.TEKST_STRAAT = new TEXT(this)
   with (this.TEKST_STRAAT)
      height = 15.0
      left = 10.0
      top = 117.0
      width = 60.0
      wrap = false
      colorNormal = "BtnText/0x8d8d8d"
      alignVertical = 1        // Middle
      fontBold = true
      text = "straat"
   endwith

   this.VELD_STRAAT = new ENTRYFIELD(this)
   with (this.VELD_STRAAT)
      dataLink = form.vraagbak_firma.rowset.fields["street"]
      height = 15.0
      left = 88.0
      top = 117.0
      width = 538.0
      colorNormal = "black/silver"
      fontBold = true
      borderStyle = 3        // None
   endwith

   this.TEKST_POSTNUMMER = new TEXT(this)
   with (this.TEKST_POSTNUMMER)
      height = 15.0
      left = 10.0
      top = 138.0
      width = 72.0
      wrap = false
      colorNormal = "BtnText/0x8d8d8d"
      alignVertical = 1        // Middle
      fontBold = true
      text = "postkode"
   endwith

   this.VELD_POSTNR = new ENTRYFIELD(this)
   with (this.VELD_POSTNR)
      dataLink = form.vraagbak_firma.rowset.fields["plz"]
      height = 15.0
      left = 88.0
      top = 138.0
      width = 96.0
      colorNormal = "black/silver"
      fontBold = true
      borderStyle = 3        // None
   endwith

   this.TEKST_STAD = new TEXT(this)
   with (this.TEKST_STAD)
      height = 18.0
      left = 194.0
      top = 138.0
      width = 30.0
      wrap = false
      colorNormal = "BtnText/0x8d8d8d"
      alignVertical = 1        // Middle
      fontBold = true
      text = "Stad"
   endwith

   this.VELD_STAD = new ENTRYFIELD(this)
   with (this.VELD_STAD)
      dataLink = form.vraagbak_firma.rowset.fields["city"]
      height = 15.0
      left = 230.0
      top = 138.0
      width = 395.0
      colorNormal = "black/silver"
      fontBold = true
      borderStyle = 3        // None
   endwith

   this.TEKST_LAND = new TEXT(this)
   with (this.TEKST_LAND)
      height = 22.0
      left = 10.0
      top = 159.0
      width = 49.0
      wrap = false
      colorNormal = "BtnText/0x8d8d8d"
      alignVertical = 1        // Middle
      fontBold = true
      text = "land"
   endwith

   this.DOOS_DATA = new CONTAINER(this)
   with (this.DOOS_DATA)
      left = 5.0
      top = 30.0
      width = 275.0
      height = 32.0
      colorNormal = "0x8d8d8d"
      borderStyle = 10        // Etched Out
   endwith

   this.DOOS_DATA.KNOP_NIEUW = new PUSHBUTTON(this.DOOS_DATA)
   with (this.DOOS_DATA.KNOP_NIEUW)
      onClick = class::KNOP_NIEUW_ONCLICK
      height = 25.0
      left = 3.0
      top = 1.0
      width = 49.0
      text = ""
      speedBar = true
      upBitmap = "RESOURCE PS_APPEND"
      fontBold = true
      tabStop = false
      speedTip = "nieuwe Data"
      colorNormal = "BtnText/blue"
      pageno = 0
   endwith

   this.DOOS_DATA.KNOP_AANPASSEN = new PUSHBUTTON(this.DOOS_DATA)
   with (this.DOOS_DATA.KNOP_AANPASSEN)
      onClick = class::KNOP_AANPASSEN_ONCLICK
      height = 25.0
      left = 56.0
      top = 1.0
      width = 49.0
      text = ""
      speedBar = true
      upBitmap = "RESOURCE ps_edit"
      fontBold = true
      tabStop = false
      speedTip = "aanpassen Data"
      colorNormal = "BtnText/blue"
      pageno = 0
   endwith

   this.DOOS_DATA.KNOP_OPSLAAN = new PUSHBUTTON(this.DOOS_DATA)
   with (this.DOOS_DATA.KNOP_OPSLAAN)
      onClick = class::KNOP_OPSLAAN_ONCLICK
      height = 25.0
      left = 107.0
      top = 1.0
      width = 49.0
      text = ""
      speedBar = true
      upBitmap = "RESOURCE ps_save"
      fontBold = true
      tabStop = false
      speedTip = "opslaan Data"
      colorNormal = "BtnText/Green"
      pageno = 0
   endwith

   this.DOOS_DATA.KNOP_ONGEDAAN = new PUSHBUTTON(this.DOOS_DATA)
   with (this.DOOS_DATA.KNOP_ONGEDAAN)
      onClick = class::KNOP_ONGEDAAN_ONCLICK
      height = 25.0
      left = 159.0
      top = 1.0
      width = 49.0
      text = ""
      speedBar = true
      upBitmap = "RESOURCE ps_abandon"
      fontBold = true
      tabStop = false
      speedTip = "ongedaan maken Data"
      colorNormal = "black/0x80ff"
      pageno = 0
   endwith

   this.DOOS_DATA.KNOP_VERWIJDEREN = new PUSHBUTTON(this.DOOS_DATA)
   with (this.DOOS_DATA.KNOP_VERWIJDEREN)
      onClick = class::KNOP_VERWIJDEREN_ONCLICK
      height = 25.0
      left = 213.0
      top = 1.0
      width = 49.0
      text = ""
      speedBar = true
      upBitmap = "RESOURCE ps_delete"
      fontBold = true
      tabStop = false
      speedTip = "Verwijderen Data"
      colorNormal = "BtnText/red"
      pageno = 0
   endwith

   this.DOOS_NAVIGATIE = new CONTAINER(this)
   with (this.DOOS_NAVIGATIE)
      left = 295.0
      top = 30.0
      width = 270.0
      height = 32.0
      colorNormal = "0x8d8d8d"
      borderStyle = 10        // Etched Out
   endwith

   this.DOOS_NAVIGATIE.KNOP_EERST = new PUSHBUTTON(this.DOOS_NAVIGATIE)
   with (this.DOOS_NAVIGATIE.KNOP_EERST)
      onClick = class::KNOP_EERST_ONCLICK
      height = 26.0
      left = 5.0
      top = 1.0
      width = 60.0
      text = ""
      upBitmap = "RESOURCE PS_FIRST"
      fontBold = true
      tabStop = false
      speedTip = "Aanvang Data"
      pageno = 0
   endwith

   this.DOOS_NAVIGATIE.KNOP_VORIG = new PUSHBUTTON(this.DOOS_NAVIGATIE)
   with (this.DOOS_NAVIGATIE.KNOP_VORIG)
      onClick = class::KNOP_VORIG_ONCLICK
      height = 25.0
      left = 70.0
      top = 1.0
      width = 60.0
      text = ""
      upBitmap = "RESOURCE PS_prev"
      fontBold = true
      tabStop = false
      speedTip = "Vorige Data"
      pageno = 0
   endwith

   this.DOOS_NAVIGATIE.KNOP_VOLGEND = new PUSHBUTTON(this.DOOS_NAVIGATIE)
   with (this.DOOS_NAVIGATIE.KNOP_VOLGEND)
      onClick = class::KNOP_VOLGEND_ONCLICK
      height = 25.0
      left = 135.0
      top = 1.0
      width = 60.0
      text = ""
      upBitmap = "RESOURCE PS_next"
      fontBold = true
      tabStop = false
      speedTip = "volgende Data"
      pageno = 0
   endwith

   this.DOOS_NAVIGATIE.KNOP_LAATST = new PUSHBUTTON(this.DOOS_NAVIGATIE)
   with (this.DOOS_NAVIGATIE.KNOP_LAATST)
      onClick = class::KNOP_LAATST_ONCLICK
      height = 25.0
      left = 200.0
      top = 1.0
      width = 60.0
      text = ""
      upBitmap = "RESOURCE PS_last"
      fontBold = true
      tabStop = false
      speedTip = "laatste Data"
      pageno = 0
   endwith

   this.KEUZEDOOS_LAND = new COMBOBOX(this)
   with (this.KEUZEDOOS_LAND)
      onGotFocus = class::KEUZEDOOS_LAND_ONGOTFOCUS
      dataLink = form.vraagbak_firma.rowset.fields["country"]
      height = 22.0
      left = 88.0
      top = 159.0
      width = 210.0
      fontBold = true
      colorNormal = "black/silver"
      autoTrim = true
      style = 2        // DropDownList
      dropDownHeight = 132.0
      borderStyle = 3        // None
   endwith

   this.TEKST_TELEFOON = new TEXT(this)
   with (this.TEKST_TELEFOON)
      height = 15.0
      left = 10.0
      top = 230.0
      width = 55.0
      wrap = false
      colorNormal = "BtnText/0x8d8d8d"
      alignVertical = 1        // Middle
      fontBold = true
      text = "telefoon"
   endwith

   this.VELD_TELEFOON = new ENTRYFIELD(this)
   with (this.VELD_TELEFOON)
      dataLink = form.vraagbak_firma.rowset.fields["basetelefon"]
      height = 15.0
      left = 85.0
      top = 230.0
      width = 210.0
      colorNormal = "black/silver"
      border = false
      fontBold = true
      borderStyle = 3        // None
   endwith

   this.TEKST_FAX = new TEXT(this)
   with (this.TEKST_FAX)
      height = 16.0
      left = 375.0
      top = 230.0
      width = 30.0
      wrap = false
      colorNormal = "BtnText/0x8d8d8d"
      alignVertical = 1        // Middle
      fontBold = true
      text = "fax"
   endwith

   this.VELD_FAX = new ENTRYFIELD(this)
   with (this.VELD_FAX)
      dataLink = form.vraagbak_firma.rowset.fields["basefax"]
      height = 15.0
      left = 415.0
      top = 230.0
      width = 210.0
      colorNormal = "black/silver"
      border = false
      fontBold = true
      borderStyle = 3        // None
   endwith

   this.TEKST_GSM = new TEXT(this)
   with (this.TEKST_GSM)
      height = 19.0
      left = 10.0
      top = 250.0
      width = 35.0
      wrap = false
      colorNormal = "BtnText/0x8d8d8d"
      alignVertical = 1        // Middle
      fontBold = true
      text = "gsm"
   endwith

   this.VELD_GSM = new ENTRYFIELD(this)
   with (this.VELD_GSM)
      dataLink = form.vraagbak_firma.rowset.fields["handy"]
      height = 15.0
      left = 85.0
      top = 250.0
      width = 210.0
      colorNormal = "black/silver"
      border = false
      fontBold = true
      borderStyle = 3        // None
   endwith

   this.TEKST_EMAIL = new TEXT(this)
   with (this.TEKST_EMAIL)
      height = 22.0
      left = 10.0
      top = 275.0
      width = 38.0
      wrap = false
      colorNormal = "BtnText/0x8d8d8d"
      alignVertical = 1        // Middle
      alignHorizontal = 2        // Right
      fontBold = true
      text = "e-Mail"
   endwith

   this.VELD_MAIL = new ENTRYFIELD(this)
   with (this.VELD_MAIL)
      onLeftDblClick = class::VELD_MAIL_ONLEFTDBLCLICK
      dataLink = form.vraagbak_firma.rowset.fields["email"]
      height = 15.0
      left = 85.0
      top = 275.0
      width = 540.0
      colorNormal = "black/silver"
      border = false
      fontBold = true
      mousePointer = 13        // Hand
      borderStyle = 3        // None
   endwith

   this.TEKST_WEB = new TEXT(this)
   with (this.TEKST_WEB)
      height = 15.0
      left = 10.0
      top = 300.0
      width = 56.0
      wrap = false
      colorNormal = "BtnText/0x8d8d8d"
      alignVertical = 1        // Middle
      fontBold = true
      text = "website"
   endwith

   this.VELD_WEBSITE = new ENTRYFIELD(this)
   with (this.VELD_WEBSITE)
      onLeftDblClick = class::VELD_WEBSITE_ONLEFTDBLCLICK
      dataLink = form.vraagbak_firma.rowset.fields["web"]
      height = 15.0
      left = 85.0
      top = 300.0
      width = 540.0
      colorNormal = "black/silver"
      border = false
      fontBold = true
      mousePointer = 13        // Hand
      borderStyle = 3        // None
   endwith

   this.KNOP_AANMAAK_CONTACT = new PUSHBUTTON(this)
   with (this.KNOP_AANMAAK_CONTACT)
      onClick = class::KNOP_AANMAAK_CONTACT_ONCLICK
      height = 35.0
      left = 648.0
      top = 88.0
      width = 67.0
      text = ""
      upBitmap = "RESOURCE #355"
      fontBold = true
      tabStop = false
      speedTip = "aanvullen"
      colorNormal = "BtnText/Blue"
   endwith

   this.ROOSTER_KONTAKTNAAM = new GRID(this)
   with (this.ROOSTER_KONTAKTNAAM)
      onLeftMouseDown = class::ROOSTER_KONTAKTNAAM_ONLEFTMOUSEDOWN
      colorNormal = "black/silver"
      dataLink = form.vraagbak_kontakt.rowset
      columns["COLUMN1"] = new GRIDCOLUMN(form.ROOSTER_KONTAKTNAAM)
      with (columns["COLUMN1"])
         dataLink = form.vraagbak_kontakt.rowset.fields["name"]
         editorType = 1        // EntryField
         width = 260.0
      endwith
      columns["COLUMN2"] = new GRIDCOLUMN(form.ROOSTER_KONTAKTNAAM)
      with (columns["COLUMN2"])
         dataLink = form.vraagbak_kontakt.rowset.fields["voornaam"]
         editorType = 1        // EntryField
         width = 155.0
      endwith
      with (columns["COLUMN1"].headingControl)
         value = "Contacts"
      endwith

      with (columns["COLUMN2"].headingControl)
         value = "voornaam"
      endwith

      headingHeight = 22.0
      cellHeight = 22.0
      hasRowLines = false
      hasIndicator = false
      hasColumnHeadings = false
      rowSelect = true
      allowEditing = false
      allowAddRows = false
      height = 110.0
      left = 290.0
      top = 510.0
      width = 420.0
   endwith

   this.KLEVER_VELD_ZOEK_DATA = new TEXTLABEL(this)
   with (this.KLEVER_VELD_ZOEK_DATA)
      height = 20.0
      left = 496.0
      top = 3.0
      width = 65.0
      transparent = true
      text = "zoek data"
      fontBold = true
   endwith

   this.TEKST_SEGMENT = new TEXT(this)
   with (this.TEKST_SEGMENT)
      height = 16.0
      left = 10.0
      top = 340.0
      width = 57.0
      wrap = false
      colorNormal = "BtnText/0x8d8d8d"
      alignVertical = 2        // Bottom
      fontBold = true
      text = "segment"
   endwith

   this.ROOSTER_KONTAKT = new GRID(this)
   with (this.ROOSTER_KONTAKT)
      colorNormal = "black/silver"
      dataLink = form.vraagbak_firma.rowset
      columns["COLUMN1"] = new GRIDCOLUMN(form.ROOSTER_KONTAKT)
      with (columns["COLUMN1"])
         dataLink = form.vraagbak_firma.rowset.fields["name"]
         editorType = 1        // EntryField
         width = 600.0
      endwith
      with (columns["COLUMN1"].headingControl)
         value = "Name"
      endwith

      headingHeight = 22.0
      cellHeight = 22.0
      hasColumnLines = false
      hasRowLines = false
      hasIndicator = false
      hasColumnHeadings = false
      colorRowSelect = "HighLightText/0xbfbfbf"
      allowEditing = false
      allowAddRows = false
      hScrollBar = 0        // Off
      height = 110.0
      left = 10.0
      top = 510.0
      width = 266.0
   endwith

   this.VELD_ZOEK_DATA = new ENTRYFIELD(this)
   with (this.VELD_ZOEK_DATA)
      onOpen = class::VELD_ZOEK_DATA_ONOPEN
      onKey = class::VELD_ZOEK_DATA_ONKEY
      height = 20.0
      left = 240.0
      top = 5.0
      width = 250.0
      colorNormal = "black/yellow"
      border = false
      value = ""
      borderStyle = 3        // None
   endwith

   this.VELD_CREATIE = new ENTRYFIELD(this)
   with (this.VELD_CREATIE)
      dataLink = form.vraagbak_firma.rowset.fields["creatie"]
      enabled = false
      height = 16.0
      left = 557.0
      top = 74.0
      width = 69.0
      colorNormal = "black/silver"
      border = false
      fontBold = true
      borderStyle = 3        // None
   endwith

   this.KLEVER_AANMAAKDAT = new TEXTLABEL(this)
   with (this.KLEVER_AANMAAKDAT)
      height = 17.0
      left = 462.0
      top = 74.0
      width = 84.0
      text = "aangemaakt"
      colorNormal = "BtnText/0x8d8d8d"
      fontBold = true
   endwith

   this.KEUZEDOOS_VERKOPER = new COMBOBOX(this)
   with (this.KEUZEDOOS_VERKOPER)
      onGotFocus = class::KEUZEDOOS_VERKOPER_ONGOTFOCUS
      dataLink = form.vraagbak_firma.rowset.fields["outside"]
      height = 22.0
      left = 380.0
      top = 370.0
      width = 245.0
      fontBold = true
      colorNormal = "black/silver"
      autoTrim = true
      style = 2        // DropDownList
      dropDownHeight = 132.0
      borderStyle = 3        // None
   endwith

   this.KLEVER_VERKOPER = new TEXTLABEL(this)
   with (this.KLEVER_VERKOPER)
      height = 17.0
      left = 308.0
      top = 370.0
      width = 58.0
      text = "verkoop"
      colorNormal = "BtnText/0x8d8d8d"
      fontBold = true
   endwith

   this.KLEVER_REGIO = new TEXTLABEL(this)
   with (this.KLEVER_REGIO)
      height = 22.0
      left = 315.0
      top = 159.0
      width = 49.0
      text = "regio"
      colorNormal = "BtnText/0x8d8d8d"
      fontBold = true
   endwith

   this.KEUZEDOOS_TAAL = new COMBOBOX(this)
   with (this.KEUZEDOOS_TAAL)
      onGotFocus = class::KEUZEDOOS_TAAL_ONGOTFOCUS
      dataLink = form.vraagbak_firma.rowset.fields["taal"]
      height = 22.0
      left = 380.0
      top = 340.0
      width = 245.0
      fontBold = true
      colorNormal = "black/silver"
      autoTrim = true
      style = 2        // DropDownList
      dropDownHeight = 132.0
      borderStyle = 3        // None
   endwith

   this.KLEVER_TAAL = new TEXTLABEL(this)
   with (this.KLEVER_TAAL)
      height = 22.0
      left = 308.0
      top = 340.0
      width = 66.0
      text = "taal"
      colorNormal = "BtnText/0x8d8d8d"
      fontBold = true
   endwith

   this.VELD_FUNKTIE = new ENTRYFIELD(this)
   with (this.VELD_FUNKTIE)
      dataLink = form.vraagbak_kontakt.rowset.fields["task"]
      height = 15.0
      left = 504.0
      top = 405.0
      width = 217.0
      colorNormal = "blue/0x787878"
      border = false
      fontBold = true
      borderStyle = 3        // None
   endwith

   this.KLEVER_FUNKTIE = new TEXTLABEL(this)
   with (this.KLEVER_FUNKTIE)
      height = 17.0
      left = 441.0
      top = 405.0
      width = 47.0
      text = "functie"
      colorNormal = "BtnText/0x787878"
      fontBold = true
   endwith

   this.KEUZEDOOS_SEGMENT = new COMBOBOX(this)
   with (this.KEUZEDOOS_SEGMENT)
      dataLink = form.vraagbak_firma.rowset.fields["soort"]
      height = 22.0
      left = 72.0
      top = 340.0
      width = 230.0
      fontBold = true
      colorNormal = "black/silver"
      autoTrim = true
      style = 2        // DropDownList
      dropDownHeight = 300.0
      borderStyle = 3        // None
   endwith

   this.KEUZEDOOS_REGIO = new COMBOBOX(this)
   with (this.KEUZEDOOS_REGIO)
      onGotFocus = class::KEUZEDOOS_REGIO_ONGOTFOCUS
      dataLink = form.vraagbak_firma.rowset.fields["province"]
      height = 22.0
      left = 387.0
      top = 159.0
      width = 238.0
      fontBold = true
      colorNormal = "black/silver"
      autoTrim = true
      style = 2        // DropDownList
      dropDownHeight = 132.0
      borderStyle = 3        // None
   endwith

   this.VELD_GSM_KONTAKT = new ENTRYFIELD(this)
   with (this.VELD_GSM_KONTAKT)
      dataLink = form.vraagbak_kontakt.rowset.fields["gsm"]
      height = 20.0
      left = 440.0
      top = 435.0
      width = 280.0
      colorNormal = "blue/0x787878"
      border = false
      fontSize = 14.0
      fontBold = true
      borderStyle = 3        // None
   endwith

   this.KLEVER_KONTAKT = new TEXTLABEL(this)
   with (this.KLEVER_KONTAKT)
      height = 17.0
      left = 10.0
      top = 370.0
      width = 50.0
      text = "contact"
      colorNormal = "BtnText/0x8d8d8d"
      fontBold = true
   endwith

   this.KONTROLEDOOS_KEUZE = new COMBOBOX(this)
   with (this.KONTROLEDOOS_KEUZE)
      height = 22.0
      left = 72.0
      top = 370.0
      width = 96.0
      colorNormal = "black/silver"
      dataSource = 'array {"Keuze","3","2","1","0","M","P","T"}'
      style = 1        // DropDown
      dropDownHeight = 132.0
   endwith

   this.KONTROLEDOOS_MONITOR = new CHECKBOX(this)
   with (this.KONTROLEDOOS_MONITOR)
      height = 17.0
      left = 231.0
      top = 370.0
      width = 69.0
      text = "monitor"
      colorNormal = "BtnText/0x8d8d8d"
      fontBold = true
   endwith

   this.VELD_TELEFOON_KONTAKT = new ENTRYFIELD(this)
   with (this.VELD_TELEFOON_KONTAKT)
      dataLink = form.vraagbak_kontakt.rowset.fields["telefon"]
      height = 20.0
      left = 65.0
      top = 435.0
      width = 284.0
      colorNormal = "blue/0x787878"
      border = false
      fontSize = 14.0
      fontBold = true
      borderStyle = 3        // None
   endwith

   this.KLEVER_GSM = new TEXTLABEL(this)
   with (this.KLEVER_GSM)
      height = 22.0
      left = 379.0
      top = 435.0
      width = 31.0
      text = "gsm"
      colorNormal = "BtnText/0x787878"
      fontBold = true
   endwith

   this.KLEVER_TEL = new TEXTLABEL(this)
   with (this.KLEVER_TEL)
      height = 22.0
      left = 5.0
      top = 435.0
      width = 30.0
      text = "tel."
      colorNormal = "BtnText/0x787878"
      fontBold = true
   endwith

   this.KLEVER_EMAIL = new TEXTLABEL(this)
   with (this.KLEVER_EMAIL)
      height = 22.0
      left = 5.0
      top = 465.0
      width = 45.0
      text = "e-Mail"
      colorNormal = "WindowText/0x787878"
      fontBold = true
   endwith

   this.VELD_EMAIL_KONTAKT = new ENTRYFIELD(this)
   with (this.VELD_EMAIL_KONTAKT)
      onLeftDblClick = class::VELD_EMAIL_KONTAKT_ONLEFTDBLCLICK
      dataLink = form.vraagbak_kontakt.rowset.fields["email"]
      height = 15.0
      left = 65.0
      top = 465.0
      width = 565.0
      colorNormal = "blue/0x787878"
      border = false
      fontBold = true
      mousePointer = 13        // Hand
      borderStyle = 3        // None
   endwith

   this.TEKST_IDNUMMER = new TEXT(this)
   with (this.TEKST_IDNUMMER)
      height = 20.0
      left = 10.0
      top = 74.0
      width = 72.0
      colorNormal = "BtnText/0x8d8d8d"
      fontBold = true
      text = "id nummer"
   endwith

   this.KEUZEDOOS_SORTEREN = new COMBOBOX(this)
   with (this.KEUZEDOOS_SORTEREN)
      onChange = class::KEUZEDOOS_SORTEREN_ONCHANGE
      height = 22.0
      left = 570.0
      top = 5.0
      width = 154.0
      colorNormal = "black/silver"
      dataSource = 'array {"selekteren","firma","postkode","stad","volgnummer"}'
      style = 2        // DropDownList
      dropDownHeight = 132.0
   endwith

   this.KLEVERNAAM = new TEXTLABEL(this)
   with (this.KLEVERNAAM)
      height = 22.0
      left = 5.0
      top = 405.0
      width = 47.0
      text = "contact"
      colorNormal = "BtnText/0x787878"
      fontName = "arial"
      fontBold = true
   endwith

   this.VELD_CONTACTNAAM = new ENTRYFIELD(this)
   with (this.VELD_CONTACTNAAM)
      dataLink = form.vraagbak_kontakt.rowset.fields["voor_en_naam"]
      height = 22.0
      left = 63.0
      top = 405.0
      width = 364.0
      colorNormal = "blue/0x787878"
      border = false
      fontName = "arial"
      fontBold = true
      borderStyle = 3        // None
   endwith

   this.RECHTHOEK_BRANCHE = new RECTANGLE(this)
   with (this.RECHTHOEK_BRANCHE)
      left = 640.0
      top = 135.0
      width = 83.0
      height = 60.0
      text = "bedrijfstak"
      colorNormal = "BtnText/0x8d8d8d"
      fontName = "arial"
      fontBold = true
   endwith

   this.RECHTHOEK_MERKEN = new RECTANGLE(this)
   with (this.RECHTHOEK_MERKEN)
      left = 640.0
      top = 200.0
      width = 83.0
      height = 60.0
      text = "merken"
      colorNormal = "BtnText/0x8d8d8d"
      fontName = "arial"
      fontBold = true
   endwith

   this.KNOP_AANMAAK_BEDRIJFSTAK = new PUSHBUTTON(this)
   with (this.KNOP_AANMAAK_BEDRIJFSTAK)
      onClick = class::KNOP_AANMAAK_BEDRIJFSTAK_ONCLICK
      height = 35.0
      left = 648.0
      top = 153.0
      width = 67.0
      text = ""
      upBitmap = "RESOURCE #1230"
      fontBold = true
      tabStop = false
      speedTip = "aanvullen"
      colorNormal = "BtnText/Blue"
   endwith

   this.KNOP_AANMAAK_MERKEN = new PUSHBUTTON(this)
   with (this.KNOP_AANMAAK_MERKEN)
      onClick = class::KNOP_AANMAAK_MERKEN_ONCLICK
      height = 35.0
      left = 648.0
      top = 219.0
      width = 67.0
      text = ""
      upBitmap = "RESOURCE #1230"
      fontBold = true
      tabStop = false
      speedTip = "aanvullen"
      colorNormal = "BtnText/Blue"
   endwith

   this.DOOS_BIJKOMEND = new CONTAINER(this)
   with (this.DOOS_BIJKOMEND)
      left = 570.0
      top = 30.0
      width = 154.0
      height = 32.0
      colorNormal = "0x8d8d8d"
      borderStyle = 10        // Etched Out
   endwith

   this.DOOS_BIJKOMEND.KNOP_ORD_OFFERTE = new PUSHBUTTON(this.DOOS_BIJKOMEND)
   with (this.DOOS_BIJKOMEND.KNOP_ORD_OFFERTE)
      onClick = class::KNOP_ORD_OFFERTE_ONCLICK
      height = 25.0
      left = 3.0
      top = 0.0
      width = 45.0
      text = ""
      upBitmap = "RESOURCE #20"
      speedTip = "Maak map aanvraag & bestelling"
      pageno = 0
   endwith

   this.DOOS_BIJKOMEND.KNOP_INFO_PROBL = new PUSHBUTTON(this.DOOS_BIJKOMEND)
   with (this.DOOS_BIJKOMEND.KNOP_INFO_PROBL)
      onClick = class::KNOP_INFO_PROBL_ONCLICK
      height = 25.0
      left = 53.0
      top = 0.0
      width = 45.0
      text = ""
      upBitmap = "RESOURCE #32"
      speedTip = "Maak map Info"
      pageno = 0
   endwith

   this.DOOS_BIJKOMEND.KNOP_EXCEL = new PUSHBUTTON(this.DOOS_BIJKOMEND)
   with (this.DOOS_BIJKOMEND.KNOP_EXCEL)
      onClick = class::KNOP_EXCEL_ONCLICK
      height = 25.0
      left = 101.0
      top = 0.0
      width = 45.0
      text = ""
      upBitmap = "RESOURCE #1040"
      pageno = 0
   endwith

   this.RECHTHOEK_TOPIC = new RECTANGLE(this)
   with (this.RECHTHOEK_TOPIC)
      left = 640.0
      top = 265.0
      width = 83.0
      height = 60.0
      text = "topics"
      colorNormal = "BtnText/0x8d8d8d"
      fontName = "arial"
      fontBold = true
   endwith

   this.KNOP_AANMAAK_TOPICS = new PUSHBUTTON(this)
   with (this.KNOP_AANMAAK_TOPICS)
      onClick = class::KNOP_AANMAAK_TOPICS_ONCLICK
      height = 35.0
      left = 647.0
      top = 283.0
      width = 67.0
      text = ""
      upBitmap = "RESOURCE #1230"
      fontBold = true
      tabStop = false
      speedTip = "aanvullen"
      colorNormal = "BtnText/Blue"
   endwith

   this.RECTANGLE1 = new RECTANGLE(this)
   with (this.RECTANGLE1)
      left = 5.0
      top = 188.0
      width = 630.0
      height = 35.0
      text = ""
      colorNormal = "white/0x8d8d8d"
   endwith

   this.TEKST_BTW = new TEXT(this)
   with (this.TEKST_BTW)
      height = 20.0
      left = 14.0
      top = 195.0
      width = 30.0
      colorNormal = "BtnText/0x8d8d8d"
      fontBold = true
      text = "btw"
   endwith

   this.VELD_BTWNR = new ENTRYFIELD(this)
   with (this.VELD_BTWNR)
      dataLink = form.vraagbak_firma.rowset.fields["btwnummer"]
      height = 15.0
      left = 44.0
      top = 197.0
      width = 210.0
      colorNormal = "black/silver"
      border = false
      fontBold = true
      borderStyle = 3        // None
   endwith

   this.TEKST_BET = new TEXT(this)
   with (this.TEKST_BET)
      height = 20.0
      left = 331.0
      top = 195.0
      width = 53.0
      colorNormal = "black/0x8d8d8d"
      fontBold = true
      text = "betaling"
   endwith

   this.VELD_BETAL = new ENTRYFIELD(this)
   with (this.VELD_BETAL)
      dataLink = form.vraagbak_firma.rowset.fields["betalingen"]
      height = 15.0
      left = 393.0
      top = 197.0
      width = 235.0
      colorNormal = "black/silver"
      border = false
      fontBold = true
      borderStyle = 3        // None
   endwith

   this.VELD_BTW = new ENTRYFIELD(this)
   with (this.VELD_BTW)
      height = 15.0
      left = 262.0
      top = 197.0
      width = 34.0
      colorNormal = "black/silver"
      border = false
      fontBold = true
      value = ""
      borderStyle = 3        // None
   endwith

   this.TEKST_PROCENT = new TEXT(this)
   with (this.TEKST_PROCENT)
      height = 17.0
      left = 306.0
      top = 196.0
      width = 15.0
      colorNormal = "black/0x8d8d8d"
      fontBold = true
      text = "%"
   endwith

   this.RECHTHOEK_BYPASS = new RECTANGLE(this)
   with (this.RECHTHOEK_BYPASS)
      left = 640.0
      top = 332.0
      width = 83.0
      height = 60.0
      text = "bypass"
      colorNormal = "BtnText/0x8d8d8d"
      fontName = "arial"
      fontBold = true
   endwith

   this.KNOP_BYPASS = new PUSHBUTTON(this)
   with (this.KNOP_BYPASS)
      onClick = class::KNOP_BYPASS_ONCLICK
      height = 35.0
      left = 647.0
      top = 350.0
      width = 67.0
      text = ""
      upBitmap = "RESOURCE #1230"
      fontBold = true
      tabStop = false
      speedTip = "aanvullen"
      colorNormal = "BtnText/Blue"
   endwith

   this.rowset = this.vraagbak_firma.rowset

  
        
  function knop_ongedaan_onClick
   form.rowset.abandon()
    form.Veld_zoek_data.setfocus()
     this.form.Doos_Data.Knop_nieuw.enabled = true
      this.form.Doos_Data.Knop_verwijderen.enabled = true
       this.form.Doos_Data.Knop_aanpassen.enabled =true
        this.form.knop_aanmaak_contact.enabled := true
        this.form.knop_aanmaak_merken.enabled := true
       this.form.knop_aanmaak_topics.enabled := true
      this.form.knop_aanmaak_bedrijfstak.enabled := true
         class::aanpassen_kleuren()
  return
  *****

  function keuzedoos_land_onGotFocus
    this.savedvalue = This.value
  return
  *****

  function Knop_verwijderen_onClick
    if msgbox("deze data verwijderen?","verwijderen ?",36)==6
           form.rowset.delete()
         endif         
    form.Veld_zoek_data.setfocus()
  return
  *****
  

  function KEUZEDOOS_SORTEREN_onChange
    form.Veld_zoek_data.value = ""
      form.Veld_zoek_data.setfocus()
     Do Case
      case this.value ="firma"
      form.rowset.indexname :="Company"
      form.rowset.exactMatch := false
       form.rowset.first()
      Case this.value ="postkode"
       form.rowset.indexname ="Postcode"
        Form.rowset.first()
      Case this.value ="stad"
        Form.Rowset.indexName = "Citycode"
         form.Rowset.First()                
     Case this.value = "volgnummer"
         form.rowset.indexname ="Identify"
                        form.veld_zoek_data.value ="00000"
       form.rowset.last()                        
      Endcase  
  return
  *****

  function Knop_aanpassen_onClick
    form.rowset.beginedit()
     class :: Zet_Knoppen()
      class::bijvoegen_kleuren()
  return
  *****

  function veld_website_onLeftDblClick(flags, col, row)
   #include winuser.h
    extern cHandle ShellExecute( cHandle, cString, cString, ;
     cString, cString, cINT ) shell32 ;
      from "ShellExecuteA"
       cUrl = ["] + this.parent.veld_website.value + ["]
     private sd         && macro needs private not local
       sd = set( "dire" ) && sometimes it *could* change dirs, so
                    && we are preventing it ...
      ShellExecute( this.parent.hwnd, "open", ;     //Iexplore.exe
                          cURL,null,null,SW_SHOWmaximized)
      * if the directory changed:
       if sd # set("dire")
        set dire to "&sd."
       endif
  return
  *****

  function KNOP_AANMAAK_BEDRIJFSTAK_onClick()
   set procedure to ..\forms\bedrijfklant2.wfm additive
    local BedrijfT,cTak
          store NULL to BedrijfT
      this.bedrijfT = new Bedrijfklant2form()
                 this.bedrijfT.top := form.top + 400
                  this.bedrijfT.Left := form.left +300
                   this.BedrijfT.Parent = this.parent
         cTak = form.rowset.Fields["idnummer"].value
       this.BedrijfT.Rowset.filter :=[idnummer=']+cTak+[']                    
       this.Bedrijft.readModal()
                close procedure ..\forms\bedrijfklant2.wfm
  return
  *****

  function KNOP_AANMAAK_MERKEN_onClick()
   local merk,cMerk
    set procedure to ..\forms\brandcust2.wfm additive
     this.merk = new brandcust2form()
       this.merk.top = form.top + 400
        this.merk.left = form.left + 300
         this.merk.parent = this.parent
                  cMerk = Form.rowset.Fields["idnummer"].value
       this.merk.rowset.filter=[idnummer=']+cMerk+[']
      this.Merk.readModal()
     close procedure ..\forms\Brandcust2.wfm
  return
  *****


  function KNOP_AANMAAK_TOPICS_onClick()
   local themas,cThemas
    set procedure to ..\forms\topicklant2.wfm additive
     this.themas = new klanttopic2Form()
      this.themas.top  = Form.top +400
       this.themas.left = form.left+300
        this.themas.parent = this.parent
                  cThemas = form.rowset.fields["idnummer"].value
        this.themas.rowset.filter =[idnummer=']+cthemas+[']
      this.themas.readmodal()
     close procedure ..\forms\topicklant2.wfm
      
  return
  *****

  function KNOP_BYPASS_onClick()
   local bijkomend,cbijkomend
    set procedure to ..\forms\ingavebypass.wfm additive
      bijkomend = new ingavebypassForm()
       bijkomend.top = Form.top +400
        bijkomend.left = form.left+300
                   bijkomend.parent = this.parent
         cbijkomend =form.rowset.fields["idnummer"].value
                    bijkomend.rowset.filter=[idnummer=']+cbijkomend+[']
         bijkomend.readmodal()
     //  bijkomend.release()
    close procedure..\forms\ingavebypass.wfm                           

//  msgbox("momenteel niet gebruikt")
   Return
  *****
  

  function KNOP_EERST_onClick
   form.rowset.first()
    form.Veld_zoek_data.setfocus()
  return
  *****

  function form_canClose
          //om te verhinderen dat de form in een verkeerd status wordt gesloten
             // indien een rowset aanwezige moet er nagezien worden of
             // de status append (3)of edit(2) is
       if Form.rowset # null and;
          (form.rowset.state ==2 or Form.rowset.state ==3)
              // indien de rowset is aangepast
        if Form.rowset.modified
          nAnswer=msgbox("gelieve op te slaan"," Data werd aangepast",32+3)
              // klik een button in Messagbox
          do case
            case nAnswer == 6
             form.rowset.save()
            case nAnswer == 7    
             form.rowset.abandon()
            otherwise
             Return false
           endcase
         endif
        endif

  return true
  ******

  function form_canNavigate(nWorkArea)
    local kan, antwoord
      kan = true
       if form.rowset.state == 3  or form.rowset.state ==2
        antwoord = msgbox("Verandering opslaan","Bevestig",32+3)
        
        if antwoord == 6
          form.rowset.save()
           form.Doos_Data.Knop_aanpassen.enabled := true
            form.Doos_Data.Knop_verwijderen.enabled := true
             form.Doos_Data.Knop_nieuw.enabled := true
          
        elseif antwoord ==7
         form.rowset.abandon()
          form.Doos_Data.Knop_aanpassen.enabled := true
           form.Doos_Data.Knop_verwijderen.enabled := true
            form.Doos_Data.Knop_nieuw.enabled := true
        else
          form.Doos_Data.Knop_aanpassen.enabled := true
           form.Doos_Data.Knop_verwijderen.enabled := true
            form.Doos_Data.Knop_nieuw.enabled := true
             form.rowset.abandon()
      kan = false                                                
        endif
       endif
  return kan
  *****

  function form_onClose()
   //this.release()    
  return
  *****

   function form_onGotFocus
     // set application reference to this form:
    if type( "_app.framewin" ) # "U"
     _app.framewin.currentForm = this
    endif
     form.Vernieuwen_scherm()
  return
  *****

  function form_onLostFocus
      // null out application's reference to this form:
    if type( "_app.framewin.currentForm" ) # "U"
     _app.framewin.currentForm := null
    endif
  return
  *****
  

  function form_onNavigate(nWorkArea)
    if form.vraagbak_kontakt.rowset.fields["verlaten"].value = true
      form.veld_Contactnaam.Fontstrikeout = true
          else
           form.veld_Contactnaam.Fontstrikeout = false
    endif         
      form.vraagbak_kontakt.rowset.refresh()    
  return
  *****
        

  function form_onOpen
   if form.vraagbak_kontakt.rowset.fields["verlaten"].value = true
    form.veld_Contactnaam.Fontstrikeout = true
   else
         form.veld_Contactnaam.Fontstrikeout = false
   endif           
        form.rowset.last()
  Return      
  *****

   function veld_IdNr_when(bOpen)
     form.Veld_IdNr.mousePointer = 12 // ?"testen"  
  return false //true
  *****

  function knop_info_probl_onClick
   if TYPE("CreateDirectory") # "FP"
     extern clogical CreateDirectory(cstring, cptr) kernel32 ;
      from "CreateDirectoryA"
    endif

  // function CheckDirectory
      local c,a
        c= "d:\dfcc_programms\klanteninfo\"
      a= upper(form.rowset.fields["name"].value)
     if CreateDirectory(c + a,null)
      else
       msgbox("Map reeds aangemaakt","Opgelet ***Bci***",64)
     endif
  return
  *****

  function knop_ord_offerte_onClick
      //api aanroepen
    if TYPE("CreateDirectory") # "FP"
     extern clogical CreateDirectory(cstring, cptr) kernel32 ;
      from "CreateDirectoryA"
    endif
     local c,a, cStr
      c= "d:\dfcc_programms\klantenoffer\"
       a=  upper(trim(form.rowset.fields["name"].value))
        if CreateDirectory(c + a,null)
       else
        msgbox("Map reeds aangemaakt","Opgelet ***Bci***",64)
    endif  
  return
  *****

  function Knop_laatst_onClick
   form.rowset.last()
   form.Veld_zoek_data.setfocus()
  return
  *****

  function veld_mail_onLeftDblClick(flags, col, row)
   Set procedure to zendemail.wfm additive
    local emailbladAA
          emailbladAA = new zendemailForm()
           emailbladAA.mdi = false
            emailbladAA.veld_adres_naar.value = this.parent.veld_mail.value
       emailbladAA.veld_Naam_naar.value = lTrim(rTRim(this.parent.vraagbak_Kontakt.rowset.fields["Name"].value)) + "  " + lTrim(rTrim(this.parent.vraagbak_Kontakt.rowset.fields["voornaam"].value))                
                    emailbladAA.readmodal()
         close procedure zendemail.wfm
        
  return
  *****
        

  function veld_email_kontakt_onLeftDblClick(flags, col, row)
  //Set procedure to zendemail.wfm additive  // test met setup prog
    local emailbladAA
          emailbladAA = new zendemailForm()
           emailbladAA.mdi = false
            emailbladAA.veld_adres_naar.value = this.parent.veld_email_kontakt.value
        emailbladAA.veld_naam_naar.value = lTrim(rTrim(this.parent.vraagbak_Kontakt.rowset.fields["Name"].value)) + "  " + lTrim(rTrim(this.parent.vraagbak_Kontakt.rowset.fields["voornaam"].value))                
            emailbladAA.readmodal()
         close procedure zendemail.wfm
  *****

  function Knop_nieuw_onClick
    local ck      //,sIndexSave
    // sIndexSave = form.rowset.indexName
      form.rowset.indexname ="identify"
       if this.form.rowset.endoFset
         ck = "0000000001"
       else
        this.form.rowset.last()
         ck= str(val(this.form.rowset.fields["idnummer"].value)+1,10,0,"0")
       endif
      //  Form.Rowset.IndexName = sIndexSave
         form.vraagbak_firma.rowset.beginappend()
          form.Veld_IdNr.value =ck
          form.vraagbak_firma.rowset.fields["creatie"].value = date()
          form.Veld_Naam.setfocus()
      class::Zet_Knoppen()
                class::bijvoegen_kleuren()
   return
  *****

  function knop_aanmaak_contact_onClick
   set procedure to ..\forms\custview.wfm additive
     local kConForm,cCont
      this.kConForm = new CustviewForm()
       this.kConForm.left = 400
        this.kconForm.top = 200
                 this.kConForm.parent= this.parent
        cCont = form.rowset.fields["idnummer"].value
     this.kConForm.rowset.filter =[idnummer=']+cCont+[']
         this.kConForm.readmodal()
   Close procedure ..\forms\custview.wfm        
  return                                              
  *****

  function Knop_volgend_onClick
     if(not form.rowset.next())
       form.rowset.next( -1 )
        msgbox( "Einde Data", " kan niet verder", 64 )
     endif
      form.Veld_zoek_data.setfocus()
  return
  *****

  function keuzedoos_verkoper_onGotFocus
   this.savedvalue = This.value
  return
  *****

  function Knop_vorig_onClick
    if(not form.rowset.next(-1))
     form.rowset.next(1)
      msgbox("Begin Data", "Kan niet verder",64)
       endif
      form.Veld_zoek_data.setfocus()  
  return
  *****

  function knop_excel_onClick
    a =  form.rowset.fields  
    b = form.vraagbak_kontakt.rowset
    set procedure to ..\system2\ExFirmdat.cc additive
        edat  = new weergave_excel()
        edat.FirmaExl(a,b)
        edat.rf = a    
        edat.rc = b
      close procedure  ..\system2\exFirmdat.cc
  return
  *****

  function keuzedoos_regio_onGotFocus
    this.savedvalue = This.value
  return
  *****

  function Knop_opslaan_onClick
     class :: Verplicht_data()  
        form.rowset.save()
     this.form.Doos_Data.Knop_nieuw.enabled := true
     this.form.Doos_Data.Knop_verwijderen.enabled = true
     this.form.Doos_Data.Knop_aanpassen.enabled =true
     this.form.knop_aanmaak_contact.enabled := true
     this.form.knop_aanmaak_merken.enabled := true
     this.form.knop_aanmaak_topics.enabled := true
     this.form.knop_aanmaak_bedrijfstak.enabled := true
     form.Veld_zoek_data.setfocus()
          class::aanpassen_kleuren()
    // this.parent.popupMenu = Null
  return
  *****

  function ROOSTER_KONTAKTNAAM_onLeftMouseDown(flags, col, row)
    if form.vraagbak_kontakt.rowset.fields["verlaten"].value = true
      form.veld_Contactnaam.Fontstrikeout = true
          else
           form.veld_Contactnaam.Fontstrikeout = false
    endif
  Return
  *****

  function Veld_zoek_data_onKey(nChar, nPosition,bShift,bControl)
     form.rowset.findkeynearest(form.Veld_zoek_data.value)
  return
  *****

  function Veld_zoek_data_onOpen
    form.Veld_zoek_data.setfocus()
  return
  *****

  function form_open()
   class::basis()
    return STAMMCUSTFORM::open()
  *****


  function form_readModal()
   class::basis()
  return STAMMCUSTFORM::readModal()
  *****

  function keuzedoos_Taal_onGotFocus
   this.savedvalue = This.value
  return
  *****
  

  function Vernieuwen_scherm
   parameter oForm
     if type( "oForm" ) == "U" or empty( oForm )
      oForm = form
     endif
      if type( "UpdateWindow" ) # "FP"
       extern CLOGICAL UpdateWindow( CHANDLE ) USER32
     endif
  RETURN UpdateWindow( oForm.hWnd )
  *****

  function Zet_Knoppen
   if this.form.rowset.state == 3 // bijvoegen van gegevens of append state
      this.form.Doos_Data.Knop_aanpassen.enabled := false
      this.form.Doos_Data.Knop_opslaan.enabled := true
      this.form.Doos_Data.Knop_ongedaan.enabled := true
      this.form.Doos_Data.Knop_verwijderen.enabled := false
      this.parent.parent.knop_aanmaak_contact.enabled :=false
      this.form.knop_aanmaak_merken.enabled :=false
      this.form.knop_aanmaak_topics.enabled :=false
      this.form.knop_aanmaak_bedrijfstak.enabled :=false
    elseif this.form.rowset.state == 2 // veranderen van gegevens of edit state
       this.form.Doos_Data.Knop_nieuw.enabled := false
       this.form.Doos_Data.Knop_opslaan.enabled := true
       this.form.Doos_Data.Knop_ongedaan.enabled := true
       this.form.Doos_Data.Knop_verwijderen.enabled := false
       this.form.knop_aanmaak_contact.enabled :=false
      this.form.knop_aanmaak_merken.enabled :=false
      this.form.knop_aanmaak_topics.enabled :=false
      this.form.knop_aanmaak_bedrijfstak.enabled :=false
    else  //alles andere uitgenomen append of edit mode
      this.form.Doos_Data.Knop_nieuw.enabled := true
      this.form.Doos_Data.Knop_opslaan.enabled := false
      this.form.Doos_Data.Knop_Ongedaan.enabled := false
      this.form.Doos_Data.Knop_verwijderen.enabled := true
     endif
  return
  *****  

  Function Verplicht_data
    if form.vraagbak_firma.RowSet.fields["soort"].Value = (Null)
     form.vraagbak_firma.rowset.fields["soort"].value = "(selecteren)"
    endif
  
   if form.vraagbak_firma.RowSet.fields["choice"].Value = Null
    form.vraagbak_firma.RowSet.fields["choice"].value = "0"
   Endif
  
        
   if form.vraagbak_firma.RowSet.fields["plz"].value = Null
    form.vraagbak_firma.RowSet.fields["PLZ"].Value = "0000000000"
   endif

   if form.vraagbak_firma.RowSet.fields["Country"].Value = Null
    form.vraagbak_firma.RowSet.fields["Country"].Value ="(selecteer land)"
   Endif
  Return
  *****

  Function basis
   set procedure to bewerken.pop additive
    form.popupMenu := new Bewerkenpopup(this,"Bewerkenpopup") // aangepast ipv this.popupMenu
     form.ScaleFontName := "Arial"
      form.ScaleFontSize := 10
     form.width +=1
    //popup in open geplaatst ipv onopen() :: parem naam van bewerk naar bewerkenpopup gezet, volgens tutorial,
    // is zo wie zo arbitrair.
          *****
   if Form.mdi = true
    form.tekst_hoofding.text := "ingave en aanpassen data"
         endif
           if form.mdi = false
          form.tekst_hoofding.text := "aanpassen Data"
          form.doos_navigatie.visible := false
          form.DOOS_DATA.KNOP_NIEUW.visible := false
           form.doos_data.knop_verwijderen.visible := false
            form.veld_zoek_data.visible := false
             form.keuzedoos_sorteren.visible := false
            form.klever_veld_zoek_data.visible := false
           form.doos_data.left := 240
          form.doos_data.top := 5
         form.doos_bijkomend.top := 5
         form.menuFile = Null
        endif
  Return
  *****

  function bijvoegen_kleuren
   form.veld_naam.colorNormal ="black/cyan"
    form.veld_straat.colorNormal ="black/cyan"
     form.veld_fax.colorNormal ="black/cyan"
      form.veld_gsm.colorNormal ="black/cyan"
        form.veld_mail.colorNormal ="black/cyan"
    
         form.Veld_postnr.colorNormal ="black/cyan"
          form.Veld_stad.colorNormal ="black/cyan"
           form.veld_telefoon.colorNormal ="black/cyan"
            form.veld_betal.colorNormal ="black/cyan"
             form.veld_btw.ColorNormal ="black/cyan"
        
         form.keuzedoos_land.ColorNormal ="black/cyan"
          form.keuzedoos_segment.ColorNormal ="black/cyan"
           form.keuzedoos_regio.ColorNormal= "black/cyan"
            form.Veld_website.ColorNormal ="Black/cyan"
        form.Keuzedoos_taal.ColorNormal="black/cyan"
          
          form.kontroledoos_keuze.ColorNormal ="Black/cyan"
           form.kontroledoos_Monitor.ColorNormal ="black/cyan"
            form.keuzedoos_verkoper.ColorNormal ="black/cyan"  
                  form.veld_btw.ColorNormal ="black/cyan"
                   form.veld_btwnr.ColorNormal ="black/cyan"
  Return
  *****

  function aanpassen_kleuren
   form.veld_naam.colorNormal ="black/silver"
    form.veld_straat.colorNormal ="black/silver"
     form.veld_fax.colorNormal ="black/silver"
      form.veld_gsm.colorNormal ="black/silver"
       form.veld_mail.colorNormal ="black/silver"
    
         form.Veld_postnr.colorNormal ="black/silver"
          form.Veld_stad.colorNormal ="black/silver"
           form.veld_telefoon.colorNormal ="black/silver"
            form.veld_betal.colorNormal ="black/silver"
             form.veld_btw.ColorNormal ="black/silver"
        
         form.keuzedoos_land.ColorNormal ="black/silver"
          form.keuzedoos_segment.ColorNormal ="black/silver"
           form.keuzedoos_regio.ColorNormal= "black/silver"
            form.Veld_website.ColorNormal = "black/silver"
             form.Keuzedoos_taal.ColorNormal="black/silver"
          
          form.kontroledoos_keuze.ColorNormal ="Black/silver"
           form.kontroledoos_Monitor.ColorNormal ="black/silver"
       form.Keuzedoos_verkoper.ColorNormal ="black/silver"
                  form.veld_btw.ColorNormal ="black/silver"
                   form.Veld_btwnr.ColorNormal ="black/silver"
        Return
   *****        

        function vraagbak_kontakt_onOpen()
     class :: naamveld("Voor_en_naam",50)
   return
        ****

   function naamVeld(cNaam,Clengte)
          local aVeld
           aVeld = new field()
            aVeld.FieldName = cNaam
       aVeld.length = clengte                
                this.rowset.Fields.add(aVeld)
   Return
   *****

   function Voor_en_naam_beforeGetValue()
           local a
                 a= trim(this.parent["name"].value) + "   " +trim(this.parent["voornaam"].value)
        return a
   *****

    function talen(groet)
     local Taal, groet
       taal = this.parent.vraagbak_firma.rowset.fields["taal"].value
        
        if taal = "D"
          groet = "Guten Tag"
        endif
      return(groet)
endclass