Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -------------------------------------------------------------------------
- 'Funciones opcionales para agregar:'
- public Sub llenarListaConCriterio (lstRef as Listbox, rsTabla as Recordset, datoLst as String, codigoLst as String, strCriterio as String)
- lstRef.clear
- rsTabla.FindFirst strCriterio
- lstRef.AddItem "Seleccione una opcion"
- lstRef.ItemData(lstRef.NewIndex) = -1
- lstRef.NewIndex = 0
- Do while not rsTabla.noMatch
- lstRef.AddItem rsTabla(datoLst)
- lstRef.itemData(lstRef.NewIndex) = rsTabla(codigoLst)
- rsTabla.findNext strCriterio
- Loop
- cerrarRs(rsTabla)
- End Sub
- ------------------------------------------------------------------------------------
- public Sub llenarComboConCriterio (comboRef as Combobox, rsTabla as Recordset, datoLst as String, codigoLst as String, strCriterio as String)
- comboRef.clear
- rsTabla.FindFirst strCriterio
- comboRef.AddItem "Seleccione una opcion"
- comboRef.ItemData(comboRef.NewIndex) = -1
- comboRef.NewIndex = 0
- Do while not rsTabla.noMatch
- comboRef.AddItem rsTabla(datoLst)
- comboRef.itemData(comboRef.NewIndex) = rsTabla(codigoLst)
- rsTabla.findNext strCriterio
- Loop
- cerrarRs(rsTabla)
- End Sub
- --------------------------------------------------------------------------------------
- private Function dameIndiceList (listRef as Listbox, intCodigo as Integer) as Integer
- Dim i as Integer
- For i=0 To listRef.ListCount - 1
- If listRef.itemData(i) = intCodigo Then
- dameIndiceList = i
- End If
- Next
- End Function
- --------------------------------------------------------------------------------------
- private Function dameIndiceCombo (comboRef as Listbox, intCodigo as Integer) as Integer
- Dim i as Integer
- For i=0 To comboRef.ListCount - 1
- If comboRef.itemData(i) = intCodigo Then
- dameIndiceCombo = i
- End If
- Next
- End Function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement