Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
CAI - Visual Basic - Libreria de funciones
Public Sub abrirDB(ByVal dbName As String, db As Database) Set db = OpenDatabase(App.Path & "\" & dbName & ".mdb") End Sub Public Sub cerrarDB(db As Database) db.Close Set db = Nothing End Sub Public Function abrirTabla(ByVal nombreTabla As String, db As Database) As Recordset Set abrirTabla = db.OpenRecordset(nombreTabla, dbOpenDynaset) End Function Public Sub cerrarTabla(ByRef nombreTabla As Recordset) nombreTabla.Close Set nombreTabla = Nothing End Sub Public Sub agregarComboPlaceholder(combo As ComboBox, texto As String) combo.AddItem (texto) combo.ItemData(combo.NewIndex) = -1 combo.ListIndex = 0 End Sub Public Sub agregarItemCombo(combo As ComboBox, tabla As Recordset, texto As String, codigo As String) combo.AddItem (tabla(texto)) combo.ItemData(combo.NewIndex) = tabla(codigo) End Sub Public Sub agregarItemLista(lista As ListBox, texto As String, codigo As String) lista.AddItem (texto) lista.ItemData(lista.NewIndex) = codigo End Sub ' Valida fecha Private Sub validarFecha(txtFecha, fechaOk) Dim fechaAChequear as String fechaAChequear = Format(txtFecha, "dd/mm/yyyy") Dim hoy as String hoy = Format(Date(), "dd/mm/yyyy") If IsDate(fechaAChequear) And fechaAChequear < hoy Then fechaOk = True Else MsgBox "Ingrese una fecha válida con formato dd/mm/yyyy" End If End Sub ' Calculo entre fechas de nacimiento Private Function calculoFechas (fecha as Date, difTiempo as Integer, periodo as String) As String calculoFechas = Format(DateAdd(periodo, -difTiempo, fecha), "yyyy-mm-dd") End Sub
run
|
edit
|
history
|
help
0
Example day of year ~ use of mod to obtain remainder
CD.SYS
Selected Poems of Rumi Dover Thrift Edition...day#doy~Poem#n
rotina de professores (select case)
No fear Shakespeare - sonnet of the day
macro for msg box in outlook
CAI Visual Basic - Ej Citas
age
Hello
liaison v2