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

'-------------------------------
' 
' mld_dienstniveaurecord CustomIncludes Event begin
%>
<!-- #INCLUDE FILE="Common.asp" -->
<%
' mld_dienstniveaurecord CustomIncludes Event end


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


'===============================
' mld_dienstniveaurecord PageSecurity begin
' mld_dienstniveaurecord PageSecurity end
'===============================

'===============================
' mld_dienstniveaurecord Open Event begin
' mld_dienstniveaurecord Open Event end
'===============================

'===============================
' mld_dienstniveaurecord OpenAnyPage Event begin
' mld_dienstniveaurecord OpenAnyPage Event end
'===============================

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

' mld_dienstniveaurecord Show begin
'===============================
' Perform the form's action
'-------------------------------
' Initialize error variables
'-------------------------------
sDienstniveauRecordErr = ""

'-------------------------------
' Select the FormAction
'-------------------------------
Select Case sForm
  Case "DienstniveauRecord"
    DienstniveauRecordAction(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
'-------------------------------
DienstniveauRecord_Show
DienstpakketSearch_Show
DienstpakketGrid_Show
'-------------------------------
' Process page templates
'-------------------------------
Parse "main", False
'-------------------------------
' Output the page to the browser
'-------------------------------
Response.write PrintVar("main")

' mld_dienstniveaurecord Show end

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

' mld_dienstniveaurecord Close Event begin
' mld_dienstniveaurecord Close Event end

cn.Close
Set cn = Nothing
UnloadTemplate
'===============================
'===============================
' Action of the Record Form
'-------------------------------
Sub DienstniveauRecordAction(sAction)
'-------------------------------
' Initialize variables  
'-------------------------------
  Dim bExecSQL: bExecSQL = true
  Dim sActionFileName : sActionFileName = ""
  Dim sParams : sParams = "?"
  Dim sWhere : sWhere = "" 
  Dim bErr : bErr = False
  Dim pPKMLD_DIENSTNIVEAU_KEY : pPKMLD_DIENSTNIVEAU_KEY = ""
  Dim fldMLD_DIENSTNIVEAU_OMSCHR : fldMLD_DIENSTNIVEAU_OMSCHR = ""
  Dim fldMLD_DIENSTNIVEAU_OPMERKING : fldMLD_DIENSTNIVEAU_OPMERKING = ""
'-------------------------------

'-------------------------------
' DienstniveauRecord Action begin
'-------------------------------
  sActionFileName = "mld_dienstniveaugrid.asp"
  sParams = sParams & "MLD_DIENSTNIVEAU_KEY=" & ToURL(GetParam("Trn_MLD_DIENSTNIVEAU_KEY")) & "&"
  sParams = sParams & "ins_discipline_key=" & ToURL(GetParam("Trn_ins_discipline_key"))

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

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

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


'-------------------------------
' Load all form fields into variables
'-------------------------------
  fldMLD_DIENSTNIVEAU_OMSCHR = GetParam("MLD_DIENSTNIVEAU_OMSCHR")
  fldMLD_DIENSTNIVEAU_OPMERKING = GetParam("MLD_DIENSTNIVEAU_OPMERKING")

'-------------------------------
' Validate fields
'-------------------------------
  if sAction = "insert" or sAction = "update" then
'-------------------------------
' DienstniveauRecord Check Event begin
' DienstniveauRecord Check Event end
'-------------------------------
    If len(sDienstniveauRecordErr) > 0 then
      exit sub
    end if
  end if
'-------------------------------


'-------------------------------
' Create SQL statement
'-------------------------------
  select case sAction
    case "insert"
'-------------------------------
' DienstniveauRecord Insert Event begin
' DienstniveauRecord Insert Event end
'-------------------------------
      sSQL = "insert into MLD_DIENSTNIVEAU (" & _
          "MLD_DIENSTNIVEAU_OMSCHR," & _
          "MLD_DIENSTNIVEAU_OPMERKING)" & _
          " values (" & _
          ToSQL(fldMLD_DIENSTNIVEAU_OMSCHR, "Text") & "," & _
          ToSQL(fldMLD_DIENSTNIVEAU_OPMERKING, "Text") & _
          ")"
    case "update"
'-------------------------------
' DienstniveauRecord Update Event begin
' DienstniveauRecord Update Event end
'-------------------------------
      sSQL = "update MLD_DIENSTNIVEAU set " & _
        "MLD_DIENSTNIVEAU_OMSCHR=" & ToSQL(fldMLD_DIENSTNIVEAU_OMSCHR, "Text") & _
        ",MLD_DIENSTNIVEAU_OPMERKING=" & ToSQL(fldMLD_DIENSTNIVEAU_OPMERKING, "Text")
      sSQL = sSQL & " where " & sWhere
    case "delete"
'-------------------------------
' DienstniveauRecord Delete Event begin
' DienstniveauRecord Delete Event end
'-------------------------------
      sSQL = "delete from MLD_DIENSTNIVEAU where " & sWhere
  end select
'-------------------------------
'-------------------------------
' DienstniveauRecord BeforeExecute Event begin
' DienstniveauRecord BeforeExecute Event end
'-------------------------------

'-------------------------------
' Execute SQL statement
'-------------------------------
if len(sDienstniveauRecordErr) > 0 then Exit Sub
  on error resume next
  if bExecSQL then 
    cn.execute sSQL
  end if
  sDienstniveauRecordErr = ProcessError
  on error goto 0
  if len(sDienstniveauRecordErr) > 0 then Exit Sub
  cn.Close
  Set cn = Nothing
  response.redirect sActionFileName & sParams
'-------------------------------
' DienstniveauRecord Action end
'-------------------------------
end sub
'===============================

'===============================
' Display Record Form
'-------------------------------
Sub DienstniveauRecord_Show()
'-------------------------------
' DienstniveauRecord Show begin
'-------------------------------
  Dim sWhere : sWhere = ""
  Dim sFormTitle: sFormTitle = "Details dienstniveau"
  Dim bPK : bPK = True

'-------------------------------
' Load primary key and form parameters
'-------------------------------
  if sDienstniveauRecordErr = "" then
    fldMLD_DIENSTNIVEAU_KEY = GetParam("MLD_DIENSTNIVEAU_KEY")
    SetVar "Trn_MLD_DIENSTNIVEAU_KEY", GetParam("MLD_DIENSTNIVEAU_KEY")
    SetVar "Trn_ins_discipline_key", GetParam("ins_discipline_key")
    pMLD_DIENSTNIVEAU_KEY = GetParam("MLD_DIENSTNIVEAU_KEY")
    SetVar "DienstniveauRecordError", ""
  else
    fldMLD_DIENSTNIVEAU_OMSCHR = GetParam("MLD_DIENSTNIVEAU_OMSCHR")
    fldMLD_DIENSTNIVEAU_OPMERKING = GetParam("MLD_DIENSTNIVEAU_OPMERKING")
    fldMLD_DIENSTNIVEAU_KEY = GetParam("Trn_MLD_DIENSTNIVEAU_KEY")
    SetVar "Trn_MLD_DIENSTNIVEAU_KEY", GetParam("Trn_MLD_DIENSTNIVEAU_KEY")
    SetVar "Trn_ins_discipline_key", GetParam("Trn_ins_discipline_key")
    pMLD_DIENSTNIVEAU_KEY = GetParam("PK_MLD_DIENSTNIVEAU_KEY")
    SetVar "sDienstniveauRecordErr", sDienstniveauRecordErr
    SetVar "FormTitle", sFormTitle
    Parse "DienstniveauRecordError", False
  end if
'-------------------------------

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

'-------------------------------

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

  if IsEmpty(pMLD_DIENSTNIVEAU_KEY) then bPK = False
  
  sWhere = sWhere & "MLD_DIENSTNIVEAU_KEY=" & ToSQL(pMLD_DIENSTNIVEAU_KEY, "Number")
  SetVar "PK_MLD_DIENSTNIVEAU_KEY", pMLD_DIENSTNIVEAU_KEY
'-------------------------------
'-------------------------------
' DienstniveauRecord Open Event begin
' DienstniveauRecord Open Event end
'-------------------------------

  SetVar "FormTitle", sFormTitle

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

'-------------------------------
' Load all fields into variables from recordset or input parameters
'-------------------------------
  if bIsUpdateMode then
    fldMLD_DIENSTNIVEAU_KEY = GetValue(rs, "MLD_DIENSTNIVEAU_KEY")

'-------------------------------
' Load data from recordset when form displayed first time
'-------------------------------
    if sDienstniveauRecordErr = "" then
      fldMLD_DIENSTNIVEAU_OMSCHR = GetValue(rs, "MLD_DIENSTNIVEAU_OMSCHR")
      fldMLD_DIENSTNIVEAU_OPMERKING = GetValue(rs, "MLD_DIENSTNIVEAU_OPMERKING")
    end if
    SetVar "DienstniveauRecordInsert", ""
    Parse "DienstniveauRecordEdit", False
'-------------------------------
' DienstniveauRecord ShowEdit Event begin
' DienstniveauRecord ShowEdit Event end
'-------------------------------
  else
    if sDienstniveauRecordErr = "" then
      fldMLD_DIENSTNIVEAU_KEY = ToHTML(GetParam("MLD_DIENSTNIVEAU_KEY"))
    end if
    SetVar "DienstniveauRecordEdit", ""
    Parse "DienstniveauRecordInsert", False
'-------------------------------
' DienstniveauRecord ShowInsert Event begin
' DienstniveauRecord ShowInsert Event end
'-------------------------------
  end if
  Parse "DienstniveauRecordCancel", false
'-------------------------------
' DienstniveauRecord Show Event begin
' DienstniveauRecord Show Event end
'-------------------------------

'-------------------------------
' Show form field
'-------------------------------
      SetVar "MLD_DIENSTNIVEAU_KEY", ToHTML(fldMLD_DIENSTNIVEAU_KEY)
      SetVar "MLD_DIENSTNIVEAU_OMSCHR", ToHTML(fldMLD_DIENSTNIVEAU_OMSCHR)
      SetVar "MLD_DIENSTNIVEAU_OPMERKING", ToHTML(fldMLD_DIENSTNIVEAU_OPMERKING)
  Parse "FormDienstniveauRecord", False

'-------------------------------
' DienstniveauRecord Close Event begin
' DienstniveauRecord Close Event end
'-------------------------------

Set rs = Nothing

'-------------------------------
' DienstniveauRecord Show end
'-------------------------------
End Sub
'===============================

'===============================
' Display Grid Form
'-------------------------------
Sub DienstpakketGrid_Show()
'-------------------------------
' Initialize variables  
'-------------------------------
  Dim rs
  Dim sWhere : sWhere = ""
  Dim sOrder : sOrder = ""
  Dim sSQL : sSQL = ""
  Dim sFormTitle: sFormTitle = "Dienstpakketten"
  Dim HasParam : HasParam = false
  Dim bReq : bReq = true
  Dim iRecordsPerPage : iRecordsPerPage = 25
  Dim iCounter : iCounter = 0
  Dim iPage : iPage = 0
  Dim bEof : bEof = False
  Dim iTmpI : iTmpI = 0
  Dim iTmpJ : iTmpJ = 0
  Dim sCountSQL : sCountSQL = ""
  Dim sActionFileName : sActionFileName = "mld_dienstniveaurecord1.asp"

  SetVar "TransitParams", "MLD_DIENSTNIVEAU_KEY=" & ToURL(GetParam("MLD_DIENSTNIVEAU_KEY")) & "&"
  SetVar "FormParams", "MLD_DIENSTNIVEAU_KEY=" & ToURL(GetParam("MLD_DIENSTNIVEAU_KEY")) & "&MLD_INS_DISCIPLINE_KEY=" & ToURL(GetParam("MLD_INS_DISCIPLINE_KEY")) & "&"

'-------------------------------
' Build WHERE statement
'-------------------------------
  pMLD_DIENSTNIVEAU_KEY = GetParam("MLD_DIENSTNIVEAU_KEY")
  if IsNumeric(pMLD_DIENSTNIVEAU_KEY) and not isEmpty(pMLD_DIENSTNIVEAU_KEY) then pMLD_DIENSTNIVEAU_KEY = ToSQL(pMLD_DIENSTNIVEAU_KEY, "Number") else pMLD_DIENSTNIVEAU_KEY = Empty
  if not isEmpty(pMLD_DIENSTNIVEAU_KEY) then
    HasParam = true
    sWhere = sWhere & "MLD_DIENSTNIVEAU_KEY=" & pMLD_DIENSTNIVEAU_KEY
  else
    bReq = false
  end if
  pMLD_INS_DISCIPLINE_KEY = GetParam("MLD_INS_DISCIPLINE_KEY")
  if IsNumeric(pMLD_INS_DISCIPLINE_KEY) and not isEmpty(pMLD_INS_DISCIPLINE_KEY) then pMLD_INS_DISCIPLINE_KEY = ToSQL(pMLD_INS_DISCIPLINE_KEY, "Number") else pMLD_INS_DISCIPLINE_KEY = Empty
  if not isEmpty(pMLD_INS_DISCIPLINE_KEY) then
    if not (sWhere = "") then sWhere = sWhere & " and "
    HasParam = true
    sWhere = sWhere & "MLD_INS_DISCIPLINE_KEY=" & pMLD_INS_DISCIPLINE_KEY
  end if


  if HasParam then
    sWhere = " AND (" & sWhere & ")"
  end if
  
'-------------------------------
' Build ORDER BY statement
'-------------------------------

'-------------------------------
' Build base SQL statement
'-------------------------------
  sSQL = "SELECT M.MLD_DIENSTNIVEAU_KEY,          M.MLD_DIENSTPAKKET_KEY,          M.MLD_STDMELDING_KEY,          S.MLD_INS_DISCIPLINE_KEY,          NVL2 (ms.ins_srtdiscipline_prefix, ms.ins_srtdiscipline_prefix || '-', '')          || d.ins_discipline_omschrijving          || ' / '          || s.mld_stdmelding_omschrijving             AS mld_tekst     FROM MLD_DIENSTPAKKET M,          ins_srtdiscipline ms,          mld_discipline d,          mld_stdmelding S    WHERE d.ins_discipline_verwijder IS NULL      AND ms.ins_srtdiscipline_key = d.ins_srtdiscipline_key      AND s.mld_ins_discipline_key = d.ins_discipline_key      AND s.mld_stdmelding_key = M.MLD_STDMELDING_KEY"
  sOrder = " ORDER BY ins_srtdiscipline_prefix,          d.ins_discipline_omschrijving,          mld_stdmelding_volgnr,          mld_stdmelding_omschrijving"
'-------------------------------

'-------------------------------
' DienstpakketGrid Open Event begin
' DienstpakketGrid Open Event end
'-------------------------------

'-------------------------------
' Assemble full SQL statement
'-------------------------------
  sSQL = sSQL & sWhere & sOrder
  if sCountSQL = "" then
    iTmpI = instr(lcase(sSQL), "select")
    iTmpJ = instr(lcase(sSQL), "from") - 1
    sCountSQL = replace(sSQL, mid(sSQL, iTmpI + 6, iTmpJ - 6), " count(*) ")
    iTmpI = instr(lcase(sCountSQl), "order by")
    if iTmpI > 1 then sCountSQL = left(sCountSQL, iTmpI - 1)
  end if
'-------------------------------

SetVar "FormTitle", sFormTitle

'-------------------------------
' Process the link to the record page
'-------------------------------
  SetVar "FormAction", sActionFileName
'-------------------------------

'-------------------------------
' Process if form has all required parameter
'-------------------------------
  if not bReq then
    SetVar "DListDienstpakketGrid", ""
    Parse "DienstpakketGridNoRecords", False
    SetVar "DienstpakketGridNavigator", ""
    Parse "FormDienstpakketGrid", False
    exit sub
  end if
'-------------------------------

'-------------------------------
' Open the recordset
'-------------------------------
  openrs rs, sSQL
'-------------------------------

'-------------------------------
' Process empty recordset
'-------------------------------
  if rs.eof then
    set rs = nothing
    SetVar "DListDienstpakketGrid", ""
    Parse "DienstpakketGridNoRecords", False
    SetVar "DienstpakketGridNavigator", ""
    Parse "FormDienstpakketGrid", False
    exit sub
  end if
'-------------------------------

'-------------------------------
' Initialize page counter and records per page
'-------------------------------
  iRecordsPerPage = 25
  iCounter = 0
'-------------------------------

'-------------------------------
' Process page scroller
'-------------------------------
  iPage = GetParam("FormDienstpakketGrid_Page")
  openrs rsCount, sCountSQL
  dResult = CLng(rsCount.fields(0).value) / iRecordsPerPage
  iPageCount = int(dResult)
  if iPageCount < dResult then iPageCount = iPageCount + 1
  SetVar "DienstpakketGridPageCount", iPageCount
  set rsCount = nothing
  if IsEmpty(iPage) then
    iPage = 1
  else
    if iPage = "last" then iPage = iPageCount
  end if
  while not rs.eof and iCounter < (iPage-1)*iRecordsPerPage
    rs.movenext
    iCounter = iCounter + 1
  wend
  iCounter = 0
'-------------------------------

'-------------------------------
' Display grid based on recordset
'-------------------------------
  while not rs.EOF  and iCounter < iRecordsPerPage
'-------------------------------
' Create field variables based on database fields
'-------------------------------
    fldMLD_DIENSTNIVEAU_KEY = GetValue(rs, "MLD_DIENSTNIVEAU_KEY")
    fldMLD_DIENSTPAKKET_KEY = GetValue(rs, "MLD_DIENSTPAKKET_KEY")
    fldMLD_TEKST_URLLink = "mld_dienstniveaurecord2.asp"
    fldMLD_TEKST_MLD_DIENSTPAKKET_KEY = GetValue(rs, "MLD_DIENSTPAKKET_KEY")
    fldMLD_TEKST = GetValue(rs, "MLD_TEKST")
'-------------------------------
' DienstpakketGrid Show begin
'-------------------------------

'-------------------------------
' DienstpakketGrid Show Event begin
' DienstpakketGrid Show Event end
'-------------------------------

'-------------------------------
' Replace Template fields with database values
'-------------------------------
    
      SetVar "MLD_DIENSTPAKKET_KEY", ToHTML(fldMLD_DIENSTPAKKET_KEY)
      SetVar "MLD_DIENSTNIVEAU_KEY", ToHTML(fldMLD_DIENSTNIVEAU_KEY)
      SetVar "MLD_TEKST", ToHTML(fldMLD_TEKST)
      SetVar "MLD_TEKST_URLLink", fldMLD_TEKST_URLLink
      SetVar "PrmMLD_TEKST_MLD_DIENSTPAKKET_KEY", ToURL(fldMLD_TEKST_MLD_DIENSTPAKKET_KEY)
    Parse "DListDienstpakketGrid", True

'-------------------------------
' DienstpakketGrid Show end
'-------------------------------

'-------------------------------
' Move to the next record and increase record counter
'-------------------------------
    rs.MoveNext
    iCounter = iCounter + 1
  wend
'-------------------------------


'-------------------------------
' DienstpakketGrid Navigation begin
'-------------------------------
  bEof = rs.eof
  if rs.eof and iPage = 1 then
	SetVar "DienstpakketGridNavigator", ""
  else
    iCounter = 1
    iHasPages = iPage
    iDisplayPages = 0
    iNumberOfPages = 10
    iHasPages = iPageCount
    if (iHasPages - iPage) < int(iNumberOfPages/2) then
      iStartPage = iHasPages - iNumberOfPages
    else
      iStartPage = iPage - iNumberOfPages + int(iNumberOfPages/2)
    end if
    if iStartPage < 0 then iStartPage = 0
    for iPageCount = iStartPage + 1 to iPage - 1
      SetVar "NavigatorPageNumber", iPageCount
      SetVar "NavigatorPageNumberView", iPageCount
      Parse "DienstpakketGridNavigatorPages", true
      iDisplayPages = iDisplayPages + 1
    next
    SetVar "NavigatorPageSwitch", "_"
    SetVar "NavigatorPageNumber", iPage
    SetVar "NavigatorPageNumberView", iPage
    Parse "DienstpakketGridNavigatorPages", true
    iDisplayPages = iDisplayPages + 1
    SetVar "NavigatorPageSwitch", ""
    iPageCount = iPage + 1
    while iDisplayPages < iNumberOfPages and iStartPage + iDisplayPages < iHasPages
      SetVar "NavigatorPageNumber", iPageCount
      SetVar "NavigatorPageNumberView", iPageCount
      Parse "DienstpakketGridNavigatorPages", true
      iDisplayPages = iDisplayPages + 1
      iPageCount = iPageCount + 1
    wend
    if bEof then
      SetVar "DienstpakketGridNavigatorLastPage", "_"
    else
      SetVar "NextPage", (iPage + 1)
    end if
    if iPage = 1 then
      SetVar "DienstpakketGridNavigatorFirstPage", "_"
    else
      SetVar "PrevPage", (iPage - 1)
    end if
    SetVar "DienstpakketGridCurrentPage", iPage
    Parse "DienstpakketGridNavigator", False
  end if
'-------------------------------
' DienstpakketGrid Navigation end
'-------------------------------

'-------------------------------
' Finish form processing
'-------------------------------
  set rs = nothing
  SetVar "DienstpakketGridNoRecords", ""
  Parse "FormDienstpakketGrid", False

'-------------------------------
' DienstpakketGrid Close Event begin
' DienstpakketGrid Close Event end
'-------------------------------
End Sub
'===============================


'===============================
' Display Search Form
'-------------------------------
Sub DienstpakketSearch_Show()
  Dim sFormTitle: sFormTitle = "Dienstpakketten"
  Dim sActionFileName: sActionFileName = "mld_dienstniveaurecord.asp"
  Dim sMLD_INS_DISCIPLINE_KEYDisplayValue: sMLD_INS_DISCIPLINE_KEYDisplayValue = "Alles"

'-------------------------------
' DienstpakketSearch Open Event begin
' DienstpakketSearch Open Event end
'-------------------------------
      SetVar "FormTitle", sFormTitle
      SetVar "ActionPage", sActionFileName
      SetVar "mld_dienstniveau_key", ToHTML(GetParam("mld_dienstniveau_key"))

'-------------------------------
' Set variables with search parameters
'-------------------------------
      fldMLD_INS_DISCIPLINE_KEY = GetParam("MLD_INS_DISCIPLINE_KEY")

'-------------------------------
' DienstpakketSearch Show begin
'-------------------------------


'-------------------------------
' DienstpakketSearch Show Event begin
' DienstpakketSearch Show Event end
'-------------------------------
      SetVar "DienstpakketSearchLBMLD_INS_DISCIPLINE_KEY", ""
      SetVar "Selected", ""
      SetVar "ID", ""
      SetVar "Value", sMLD_INS_DISCIPLINE_KEYDisplayValue
      Parse "DienstpakketSearchLBMLD_INS_DISCIPLINE_KEY", True
      openrs rsMLD_INS_DISCIPLINE_KEY, "SELECT   ins_discipline_key,          sr.ins_srtdiscipline_prefix || '-' || ins_discipline_omschrijving     FROM mld_v_aanwezigdiscipline ml, INS_SRTDISCIPLINE sr    WHERE ml.ins_srtdiscipline_key = sr.ins_srtdiscipline_key ORDER BY 2"
      while not rsMLD_INS_DISCIPLINE_KEY.EOF
        SetVar "ID", GetValue(rsMLD_INS_DISCIPLINE_KEY, 0) : SetVar "Value", GetValue(rsMLD_INS_DISCIPLINE_KEY, 1)
        if cstr(GetValue(rsMLD_INS_DISCIPLINE_KEY, 0)) = cstr(fldMLD_INS_DISCIPLINE_KEY) then SetVar "Selected", "SELECTED" else SetVar "Selected", ""
        Parse "DienstpakketSearchLBMLD_INS_DISCIPLINE_KEY", True
        rsMLD_INS_DISCIPLINE_KEY.MoveNext
      wend
      set rsMLD_INS_DISCIPLINE_KEY = nothing
    

'-------------------------------
' DienstpakketSearch Show end
'-------------------------------

'-------------------------------
' DienstpakketSearch Close Event begin
' DienstpakketSearch Close Event end
'-------------------------------
      Parse "FormDienstpakketSearch", False
End Sub
'===============================

%>