<%
'
'    Filename: cnt_disciplinerecord.asp
'    Generated with CodeCharge 2.0.5
'    ASP 2.0 & Templates.ccp build 11/30/2001
'

'-------------------------------
' 
' cnt_disciplinerecord CustomIncludes Event begin
%>
<!-- #include file="common.asp" -->
<%
' cnt_disciplinerecord CustomIncludes Event end


'===============================
' Save Page and File Name available into variables
'-------------------------------
sFileName = "cnt_disciplinerecord.asp"
sTemplateFileName = "cnt_disciplinerecord.html"
'===============================


'===============================
' cnt_disciplinerecord PageSecurity begin
' cnt_disciplinerecord PageSecurity end
'===============================

'===============================
' cnt_disciplinerecord Open Event begin
' cnt_disciplinerecord Open Event end
'===============================

'===============================
' cnt_disciplinerecord OpenAnyPage Event begin
' cnt_disciplinerecord OpenAnyPage Event end
'===============================

'===============================
'Save the name of the form and type of action into the variables
'-------------------------------
sAction = GetParam("FormAction")
sForm = GetParam("FormName")
'===============================

' cnt_disciplinerecord Show begin
'===============================
' Perform the form's action
'-------------------------------
' Initialize error variables
'-------------------------------
sDisciplineRecordErr = ""

'-------------------------------
' Select the FormAction
'-------------------------------
Select Case sForm
  Case "DisciplineRecord"
    DisciplineRecordAction(sAction)
end select
'===============================

'===============================
' Display page
'-------------------------------
' Load HTML template for this page
'-------------------------------
LoadTemplate sAppPath & sTemplateFileName, "main"
'-------------------------------
' Load HTML template of Header and Footer
'-------------------------------
'-------------------------------
SetVar "FileName", sFileName


'-------------------------------
' Step through each form
'-------------------------------
DisciplineRecord_Show
'-------------------------------
' Process page templates
'-------------------------------
Parse "main", False
'-------------------------------
' Output the page to the browser
'-------------------------------
Response.write PrintVar("main")

' cnt_disciplinerecord Show end

'-------------------------------
' Destroy all object variables
'-------------------------------

' cnt_disciplinerecord Close Event begin
' cnt_disciplinerecord Close Event end

cn.Close
Set cn = Nothing
UnloadTemplate
'===============================
'===============================
' Action of the Record Form
'-------------------------------
Sub DisciplineRecordAction(sAction)
'-------------------------------
' Initialize variables  
'-------------------------------
  Dim bExecSQL: bExecSQL = true
  Dim sActionFileName : sActionFileName = ""
  Dim sParams : sParams = "?"
  Dim sWhere : sWhere = "" 
  Dim bErr : bErr = False
  Dim pPKINS_DISCIPLINE_KEY : pPKINS_DISCIPLINE_KEY = ""
  Dim fldINS_DISCIPLINE_OMSCHRIJVING : fldINS_DISCIPLINE_OMSCHRIJVING = ""
  Dim fldINS_DISCIPLINE_MODULE : fldINS_DISCIPLINE_MODULE = ""
  Dim fldCNT_SRTCONTRACT_TYPE : fldCNT_SRTCONTRACT_TYPE = ""
  Dim fldCNT_DISC_PARAMS_FACTUURPCT : fldCNT_DISC_PARAMS_FACTUURPCT = ""
  Dim fldCNT_DISC_PARAMS_FACTUURMARGE : fldCNT_DISC_PARAMS_FACTUURMARGE = ""
  Dim fldCNT_DISC_PARAMS_FACTUURAPPR : fldCNT_DISC_PARAMS_FACTUURAPPR = ""
  Dim fldCNT_DISC_PARAMS_FACTUURGRENS : fldCNT_DISC_PARAMS_FACTUURGRENS = ""
  Dim fldPRS_KOSTENSOORT_KEY : fldPRS_KOSTENSOORT_KEY = ""
  Dim fldINS_DISCIPLINE_EMAIL : fldINS_DISCIPLINE_EMAIL = ""
  Dim fldCNT_DISC_PARAMS_OPMERKING : fldCNT_DISC_PARAMS_OPMERKING = ""
'-------------------------------

'-------------------------------
' DisciplineRecord Action begin
'-------------------------------
  sActionFileName = "cnt_disciplinegrid.asp"
  sParams = sParams & "sINS_DISCIPLINE_OMSCHRIJVING=" & ToURL(GetParam("Trn_sINS_DISCIPLINE_OMSCHRIJVING"))

'-------------------------------
' CANCEL action
'-------------------------------
  if sAction = "cancel" then

'-------------------------------
' DisciplineRecord BeforeCancel Event begin
' DisciplineRecord BeforeCancel Event end
'-------------------------------
    cn.Close
    Set cn = Nothing
    response.redirect sActionFileName & sParams
  end if
'-------------------------------

'-------------------------------
' Build WHERE statement
'-------------------------------
  if sAction = "update" or sAction = "delete" then
    pPKINS_DISCIPLINE_KEY = GetParam("PK_INS_DISCIPLINE_KEY")
    if IsEmpty(pPKINS_DISCIPLINE_KEY) then exit sub
    sWhere = "INS_DISCIPLINE_KEY=" & ToSQL(pPKINS_DISCIPLINE_KEY, "Number")
  end if
'-------------------------------


'-------------------------------
' Load all form fields into variables
'-------------------------------
  fldINS_DISCIPLINE_OMSCHRIJVING = GetParam("INS_DISCIPLINE_OMSCHRIJVING")
  fldINS_DISCIPLINE_MODULE = GetParam("INS_DISCIPLINE_MODULE")
  fldCNT_SRTCONTRACT_TYPE = GetParam("CNT_SRTCONTRACT_TYPE")
  fldCNT_DISC_PARAMS_FACTUURPCT = GetParam("CNT_DISC_PARAMS_FACTUURPCT")
  fldCNT_DISC_PARAMS_FACTUURMARGE = GetParam("CNT_DISC_PARAMS_FACTUURMARGE")
  fldCNT_DISC_PARAMS_FACTUURAPPR = getCheckBoxValue(GetParam("CNT_DISC_PARAMS_FACTUURAPPR"), "1", "0", "Number")
  fldCNT_DISC_PARAMS_FACTUURGRENS = GetParam("CNT_DISC_PARAMS_FACTUURGRENS")
  fldPRS_KOSTENSOORT_KEY = GetParam("PRS_KOSTENSOORT_KEY")
  fldINS_DISCIPLINE_EMAIL = GetParam("INS_DISCIPLINE_EMAIL")
  fldCNT_DISC_PARAMS_OPMERKING = GetParam("CNT_DISC_PARAMS_OPMERKING")

'-------------------------------
' Validate fields
'-------------------------------
  if sAction = "insert" or sAction = "update" then
    if IsEmpty(fldINS_DISCIPLINE_OMSCHRIJVING) then
      sDisciplineRecordErr = sDisciplineRecordErr & "De waarde in veld Omschrijving is verplicht.<br>"
    end if
    if not isNumeric(fldCNT_SRTCONTRACT_TYPE) then
      sDisciplineRecordErr = sDisciplineRecordErr & "De waarde in veld Contracttype is niet correct.<br>"
    end if
    if not isNumeric(fldCNT_DISC_PARAMS_FACTUURPCT) then
      sDisciplineRecordErr = sDisciplineRecordErr & "De waarde in veld Factuurmarge percentage is niet correct.<br>"
    end if
    if not isNumeric(fldCNT_DISC_PARAMS_FACTUURMARGE) then
      sDisciplineRecordErr = sDisciplineRecordErr & "De waarde in veld Factuurmarge EURO is niet correct.<br>"
    end if
    if not isNumeric(fldPRS_KOSTENSOORT_KEY) then
      sDisciplineRecordErr = sDisciplineRecordErr & "De waarde in veld Kostensoort is niet correct.<br>"
    end if
'-------------------------------
' DisciplineRecord Check Event begin
' DisciplineRecord Check Event end
'-------------------------------
    If len(sDisciplineRecordErr) > 0 then
      exit sub
    end if
  end if
'-------------------------------


'-------------------------------
' Create SQL statement
'-------------------------------
  select case sAction
    case "insert"
'-------------------------------
' DisciplineRecord Insert Event begin
' DisciplineRecord Insert Event end
'-------------------------------
      sSQL = "insert into INS_TAB_DISCIPLINE (" & _
          "INS_DISCIPLINE_OMSCHRIJVING," & _
          "INS_DISCIPLINE_MODULE," & _
          "PRS_KOSTENSOORT_KEY," & _
          "INS_DISCIPLINE_EMAIL)" & _
          " values (" & _
          ToSQL(fldINS_DISCIPLINE_OMSCHRIJVING, "Text") & "," & _
          ToSQL(fldINS_DISCIPLINE_MODULE, "Text") & "," & _
          ToSQL(fldPRS_KOSTENSOORT_KEY, "Number") & "," & _
          ToSQL(fldINS_DISCIPLINE_EMAIL, "Text") & _
          ")"
    case "update"
'-------------------------------
' DisciplineRecord Update Event begin
' DisciplineRecord Update Event end
'-------------------------------
      sSQL = "update INS_TAB_DISCIPLINE set " & _
        "INS_DISCIPLINE_OMSCHRIJVING=" & ToSQL(fldINS_DISCIPLINE_OMSCHRIJVING, "Text") & _
        ",INS_DISCIPLINE_MODULE=" & ToSQL(fldINS_DISCIPLINE_MODULE, "Text") & _
        ",PRS_KOSTENSOORT_KEY=" & ToSQL(fldPRS_KOSTENSOORT_KEY, "Number") & _
        ",INS_DISCIPLINE_EMAIL=" & ToSQL(fldINS_DISCIPLINE_EMAIL, "Text")
      sSQL = sSQL & " where " & sWhere
    case "delete"
'-------------------------------
' DisciplineRecord Delete Event begin
sSql = "UPDATE INS_TAB_DISCIPLINE SET INS_DISCIPLINE_VERWIJDER="+sysdate+ _
        " WHERE INS_DISCIPLINE_KEY = " & ToSQL(GetParam("PK_INS_DISCIPLINE_KEY"), "Number")
' DisciplineRecord Delete Event end
'-------------------------------
      if sSQL = "" then
      sSQL = "delete from INS_TAB_DISCIPLINE where " & sWhere
      end if
  end select
'-------------------------------
'-------------------------------
' DisciplineRecord BeforeExecute Event begin
' DisciplineRecord BeforeExecute Event end
'-------------------------------

'-------------------------------
' Execute SQL statement
'-------------------------------
if len(sDisciplineRecordErr) > 0 then Exit Sub
  on error resume next
  if bExecSQL then 
    cn.execute sSQL
  end if
  sDisciplineRecordErr = ProcessError
  on error goto 0
  if len(sDisciplineRecordErr) > 0 then Exit Sub
  select case sAction
    case "insert"
'-------------------------------
' DisciplineRecord AfterInsert Event begin
'En voeg de params toe aan CNT_disc
'Zoek eerst de key op.
DiscSql = "SELECT INS_DISCIPLINE_KEY "&_
          "FROM CNT_V_AANWEZIGDISCIPLINE "&_
          "WHERE INS_DISCIPLINE_OMSCHRIJVING="&ToSql(fldINS_DISCIPLINE_OMSCHRIJVING,"Text")
openrs rsDisc, DiscSql
if not rsDisc.EOF then
  ins_discipline_key = getValue(rsDisc,"INS_DISCIPLINE_KEY")
  DiscSql = "INSERT INTO CNT_DISC_PARAMS("&_
            "  CNT_INS_DISCIPLINE_KEY,"&_
            "  CNT_DISC_PARAMS_FACTUURPCT,"&_
            "  CNT_DISC_PARAMS_FACTUURMARGE,"&_
            "  CNT_DISC_PARAMS_FACTUURGRENS,"&_
            "  CNT_DISC_PARAMS_FACTUURAPPR,"&_
            "  CNT_DISC_PARAMS_OPMERKING,"&_
            "  CNT_SRTCONTRACT_TYPE) "&_
            "VALUES("&_
            ToSql(ins_discipline_key,"Number") & "," &_
            ToSql(fldCNT_DISC_PARAMS_FACTUURPCT,"Number")& "," &_
            ToSql(fldCNT_DISC_PARAMS_FACTUURMARGE,"Number")& "," &_
            ToSql(fldCNT_DISC_PARAMS_FACTUURGRENS,"Number")& "," &_
            ToSql(fldCNT_DISC_PARAMS_FACTUURAPPR,"Number")& "," &_
            ToSql(fldCNT_DISC_PARAMS_OPMERKING,"Text")& "," &_
            ToSql(fldCNT_SRTCONTRACT_TYPE,"Number")& ")"
  on error resume next
  if bExecSQL then
    cn.execute DiscSQL
  end if
  sDisciplineRecordErr = ProcessError
  on error goto 0
  if len(sDisciplineRecordErr) > 0 then
         cn.execute "DELETE FROM CNT_V_AANWEZIGDISCIPLINE " &_
                    " WHERE INS_DISCIPLINE_KEY = " & ToSql(ins_discipline_key,"Number")
         Exit Sub
      End If
end if
rsDisc.Close
' DisciplineRecord AfterInsert Event end
'-------------------------------
    case "update"
'-------------------------------
' DisciplineRecord AfterUpdate Event begin
'En update de params in CNT_disc
DiscSql = "UPDATE CNT_DISC_PARAMS SET "&_
          "  CNT_DISC_PARAMS_FACTUURPCT="&ToSql(fldCNT_DISC_PARAMS_FACTUURPCT,"Number")&","&_
          "  CNT_DISC_PARAMS_FACTUURMARGE="&ToSql(fldCNT_DISC_PARAMS_FACTUURMARGE,"Number")&","&_
          "  CNT_DISC_PARAMS_FACTUURGRENS="&ToSql(fldCNT_DISC_PARAMS_FACTUURGRENS,"Number")&","&_
          "  CNT_DISC_PARAMS_FACTUURAPPR="&ToSql(fldCNT_DISC_PARAMS_FACTUURAPPR,"Number")&","&_
          "  CNT_DISC_PARAMS_OPMERKING="&ToSql(fldCNT_DISC_PARAMS_OPMERKING,"Text")&","&_
          "  CNT_SRTCONTRACT_TYPE="&ToSql(fldCNT_SRTCONTRACT_TYPE,"Number")&" "&_
          "WHERE CNT_INS_DISCIPLINE_KEY="&pPKINS_DISCIPLINE_KEY
on error resume next
if bExecSQL then
  cn.execute DiscSQL
end if
sDisciplineRecordErr = ProcessError
on error goto 0
if len(sDisciplineRecordErr) > 0 then Exit Sub
' DisciplineRecord AfterUpdate Event end
'-------------------------------
  end select
  cn.Close
  Set cn = Nothing
  response.redirect sActionFileName & sParams
'-------------------------------
' DisciplineRecord Action end
'-------------------------------
end sub
'===============================

'===============================
' Display Record Form
'-------------------------------
Sub DisciplineRecord_Show()
'-------------------------------
' DisciplineRecord Show begin
'-------------------------------
  Dim sWhere : sWhere = ""
  Dim sFormTitle: sFormTitle = "Details contractsoort"
  Dim bPK : bPK = True
  Dim sPRS_KOSTENSOORT_KEYDisplayValue: sPRS_KOSTENSOORT_KEYDisplayValue = ""

'-------------------------------
' Load primary key and form parameters
'-------------------------------
  if sDisciplineRecordErr = "" then
    SetVar "Trn_sINS_DISCIPLINE_OMSCHRIJVING", GetParam("sINS_DISCIPLINE_OMSCHRIJVING")
    pINS_DISCIPLINE_KEY = GetParam("INS_DISCIPLINE_KEY")
    SetVar "DisciplineRecordError", ""
  else
    fldINS_DISCIPLINE_OMSCHRIJVING = GetParam("INS_DISCIPLINE_OMSCHRIJVING")
    fldINS_DISCIPLINE_MODULE = GetParam("INS_DISCIPLINE_MODULE")
    fldPRS_KOSTENSOORT_KEY = GetParam("PRS_KOSTENSOORT_KEY")
    fldINS_DISCIPLINE_EMAIL = GetParam("INS_DISCIPLINE_EMAIL")
    SetVar "Trn_sINS_DISCIPLINE_OMSCHRIJVING", GetParam("Trn_sINS_DISCIPLINE_OMSCHRIJVING")
    pINS_DISCIPLINE_KEY = GetParam("PK_INS_DISCIPLINE_KEY")
    SetVar "sDisciplineRecordErr", sDisciplineRecordErr
    SetVar "FormTitle", sFormTitle
    Parse "DisciplineRecordError", False
  end if
'-------------------------------

'-------------------------------
' Load all form fields

  fldCNT_SRTCONTRACT_TYPE = GetParam("CNT_SRTCONTRACT_TYPE")
  fldCNT_DISC_PARAMS_FACTUURPCT = GetParam("CNT_DISC_PARAMS_FACTUURPCT")
  fldCNT_DISC_PARAMS_FACTUURMARGE = GetParam("CNT_DISC_PARAMS_FACTUURMARGE")
  fldCNT_DISC_PARAMS_FACTUURAPPR = GetParam("CNT_DISC_PARAMS_FACTUURAPPR")
  fldCNT_DISC_PARAMS_FACTUURGRENS = GetParam("CNT_DISC_PARAMS_FACTUURGRENS")
  fldCNT_DISC_PARAMS_OPMERKING = GetParam("CNT_DISC_PARAMS_OPMERKING")
'-------------------------------

'-------------------------------
' Build WHERE statement

  if IsEmpty(pINS_DISCIPLINE_KEY) then bPK = False
  
  sWhere = sWhere & "INS_DISCIPLINE_KEY=" & ToSQL(pINS_DISCIPLINE_KEY, "Number")
  SetVar "PK_INS_DISCIPLINE_KEY", pINS_DISCIPLINE_KEY
'-------------------------------
'-------------------------------
' DisciplineRecord Open Event begin
' DisciplineRecord Open Event end
'-------------------------------

  SetVar "FormTitle", sFormTitle

'-------------------------------
' Build SQL statement and open recordset
'-------------------------------
  sSQL = "select * from INS_TAB_DISCIPLINE where " & sWhere
  openrs rs, sSQL
  bIsUpdateMode = (bPK and not(sAction = "insert" and sForm = "DisciplineRecord") and not rs.eof)
'-------------------------------

'-------------------------------
' Load all fields into variables from recordset or input parameters
'-------------------------------
  if bIsUpdateMode then
    fldINS_DISCIPLINE_KEY = GetValue(rs, "INS_DISCIPLINE_KEY")
    fldINS_DISCIPLINE_MODULE = GetValue(rs, "INS_DISCIPLINE_MODULE")

'-------------------------------
' Load data from recordset when form displayed first time
'-------------------------------
    if sDisciplineRecordErr = "" then
      fldINS_DISCIPLINE_OMSCHRIJVING = GetValue(rs, "INS_DISCIPLINE_OMSCHRIJVING")
      fldPRS_KOSTENSOORT_KEY = GetValue(rs, "PRS_KOSTENSOORT_KEY")
      fldINS_DISCIPLINE_EMAIL = GetValue(rs, "INS_DISCIPLINE_EMAIL")
    end if
    SetVar "DisciplineRecordInsert", ""
    Parse "DisciplineRecordEdit", False
'-------------------------------
' DisciplineRecord ShowEdit Event begin
' DisciplineRecord ShowEdit Event end
'-------------------------------
  else
    if sDisciplineRecordErr = "" then
      fldINS_DISCIPLINE_MODULE= "CNT"
    end if
    SetVar "DisciplineRecordEdit", ""
    Parse "DisciplineRecordInsert", False
'-------------------------------
' DisciplineRecord ShowInsert Event begin
' DisciplineRecord ShowInsert Event end
'-------------------------------
  end if
  Parse "DisciplineRecordCancel", false
  if sDisciplineRecordErr = "" then
'-------------------------------
' DisciplineRecord Show Event begin
if fldINS_DISCIPLINE_KEY = "" then
  fldINS_SRTDISCIPLINE_KEY = pINS_SRTDISCIPLINE_KEY
end if
'Laad de records uit CNT_disc_params indien van toepassing
if fldINS_DISCIPLINE_KEY <> "" then
  DiscSql = "SELECT CNT_DISC_PARAMS_FACTUURPCT, "&_
            "  CNT_DISC_PARAMS_FACTUURMARGE, "&_
            "  CNT_DISC_PARAMS_FACTUURGRENS, "&_
            "  CNT_DISC_PARAMS_FACTUURAPPR, "&_
            "  CNT_DISC_PARAMS_OPMERKING, " &_
            "  CNT_SRTCONTRACT_TYPE "&_
            "FROM CNT_DISC_PARAMS "&_
            "WHERE CNT_INS_DISCIPLINE_key = " & ToSQL(fldINS_DISCIPLINE_KEY, "Number")
  openrs rsDisc, DiscSql
  if not rsDisc.EOF then
    fldCNT_DISC_PARAMS_FACTUURPCT= getValue(rsDisc,"CNT_DISC_PARAMS_FACTUURPCT")
    fldCNT_DISC_PARAMS_FACTUURMARGE= getValue(rsDisc,"CNT_DISC_PARAMS_FACTUURMARGE")
    fldCNT_DISC_PARAMS_FACTUURGRENS= getValue(rsDisc,"CNT_DISC_PARAMS_FACTUURGRENS")
    fldCNT_DISC_PARAMS_FACTUURAPPR= getValue(rsDisc,"CNT_DISC_PARAMS_FACTUURAPPR")
    fldCNT_DISC_PARAMS_OPMERKING= getValue(rsDisc,"CNT_DISC_PARAMS_OPMERKING")
    fldCNT_SRTCONTRACT_TYPE = getValue(rsDisc,"CNT_SRTCONTRACT_TYPE")
  end if
  rsDisc.Close
end if
' DisciplineRecord Show Event end
'-------------------------------
  end if

'-------------------------------
' Show form field
'-------------------------------
      SetVar "INS_DISCIPLINE_KEY", ToHTML(fldINS_DISCIPLINE_KEY)
      SetVar "INS_DISCIPLINE_OMSCHRIJVING", ToHTML(fldINS_DISCIPLINE_OMSCHRIJVING)
      SetVar "INS_DISCIPLINE_MODULE", ToHTML(fldINS_DISCIPLINE_MODULE)
      SetVar "DisciplineRecordLBCNT_SRTCONTRACT_TYPE", ""
      openrs rsCNT_SRTCONTRACT_TYPE, "select CNT_TYPECONTRACT_KEY, CNT_TYPECONTRACT_OMSCHRIJVING from CNT_TYPECONTRACT order by 2"
      while not rsCNT_SRTCONTRACT_TYPE.EOF
        SetVar "ID", GetValue(rsCNT_SRTCONTRACT_TYPE, 0) : SetVar "Value", GetValue(rsCNT_SRTCONTRACT_TYPE, 1)
        if cstr(GetValue(rsCNT_SRTCONTRACT_TYPE, 0)) = cstr(fldCNT_SRTCONTRACT_TYPE) then SetVar "Selected", "SELECTED" else SetVar "Selected", ""
        Parse "DisciplineRecordLBCNT_SRTCONTRACT_TYPE", True
        rsCNT_SRTCONTRACT_TYPE.MoveNext
      wend
      set rsCNT_SRTCONTRACT_TYPE = nothing
    
      SetVar "CNT_DISC_PARAMS_FACTUURPCT", ToHTML(fldCNT_DISC_PARAMS_FACTUURPCT)
      SetVar "CNT_DISC_PARAMS_FACTUURMARGE", ToHTML(fldCNT_DISC_PARAMS_FACTUURMARGE)
  if (LCase(fldCNT_DISC_PARAMS_FACTUURAPPR) = LCase("1")) then
    SetVar "CNT_DISC_PARAMS_FACTUURAPPR_CHECKED", "CHECKED"
  else
    SetVar "CNT_DISC_PARAMS_FACTUURAPPR_CHECKED", ""
  end if

      SetVar "CNT_DISC_PARAMS_FACTUURGRENS", ToHTML(fldCNT_DISC_PARAMS_FACTUURGRENS)
      SetVar "DisciplineRecordLBPRS_KOSTENSOORT_KEY", ""
      SetVar "Selected", ""
      SetVar "ID", ""
      SetVar "Value", sPRS_KOSTENSOORT_KEYDisplayValue
      Parse "DisciplineRecordLBPRS_KOSTENSOORT_KEY", True
      openrs rsPRS_KOSTENSOORT_KEY, "select PRS_KOSTENSOORT_KEY, PRS_KOSTENSOORT_OMS from PRS_KOSTENSOORT order by 2"
      while not rsPRS_KOSTENSOORT_KEY.EOF
        SetVar "ID", GetValue(rsPRS_KOSTENSOORT_KEY, 0) : SetVar "Value", GetValue(rsPRS_KOSTENSOORT_KEY, 1)
        if cstr(GetValue(rsPRS_KOSTENSOORT_KEY, 0)) = cstr(fldPRS_KOSTENSOORT_KEY) then SetVar "Selected", "SELECTED" else SetVar "Selected", ""
        Parse "DisciplineRecordLBPRS_KOSTENSOORT_KEY", True
        rsPRS_KOSTENSOORT_KEY.MoveNext
      wend
      set rsPRS_KOSTENSOORT_KEY = nothing
    
      SetVar "INS_DISCIPLINE_EMAIL", ToHTML(fldINS_DISCIPLINE_EMAIL)
      SetVar "CNT_DISC_PARAMS_OPMERKING", ToHTML(fldCNT_DISC_PARAMS_OPMERKING)
  Parse "FormDisciplineRecord", False

'-------------------------------
' DisciplineRecord Close Event begin
' DisciplineRecord Close Event end
'-------------------------------

Set rs = Nothing

'-------------------------------
' DisciplineRecord Show end
'-------------------------------
End Sub
'===============================
%>