FormPlantilla.frm, imagen del formulario
Uso: es la pantalla que permite ingresar los datos a la plantilla, algunas ventanas se hacen invisibles dependiendo si tienen o no una variable asociada
FormPlantilla.frm |
Private Sub UserForm_Initialize() Close Open arfijo For Random As 1 Len = largof Get 1, 1, fij Close nombre_plantilla_actual = plantilla Close Open archconf For Random As 1 Len = largoC Get 1, 1, conf ultimo = Val(conf.nombre) For z% = 2 To ultimo + 1 Get 1, z%, conf If Trim(conf.nombre) = nombre_plantilla_actual Then FormPlantilla.Caption = conf.nombre Label1.Caption = conf.Label1 Label2.Caption = conf.Label2 Label3.Caption = conf.Label3 Label4.Caption = conf.Label4 Label5.Caption = conf.Label5 Label6.Caption = conf.Label6 Label7.Caption = conf.Label7 Label8.Caption = conf.Label8 Label9.Caption = conf.Label9 Label10.Caption = conf.Label10 If Trim(Label1.Caption) = "" Then ComboBox1.Visible = False If Trim(Label2.Caption) = "" Then ComboBox2.Visible = False If Trim(Label3.Caption) = "" Then ComboBox3.Visible = False If Trim(Label4.Caption) = "" Then ComboBox4.Visible = False If Trim(Label5.Caption) = "" Then TextBox1.Visible = False If Trim(Label6.Caption) = "" Then TextBox2.Visible = False If Trim(Label7.Caption) = "" Then TextBox3.Visible = False If Trim(Label8.Caption) = "" Then TextBox4.Visible = False If Trim(Label9.Caption) = "" Then TextBox5.Visible = False If Trim(Label10.Caption) = "" Then TextBox6.Visible = False ComboBox1.AddItem Trim(conf.comb11) ComboBox1.AddItem Trim(conf.comb12) ComboBox1.AddItem Trim(conf.comb13) ComboBox2.AddItem Trim(conf.comb21) ComboBox2.AddItem Trim(conf.comb22) ComboBox2.AddItem Trim(conf.comb23) ComboBox3.AddItem Trim(conf.comb31) ComboBox3.AddItem Trim(conf.comb32) ComboBox3.AddItem Trim(conf.comb33) ComboBox4.AddItem Trim(conf.comb41) ComboBox4.AddItem Trim(conf.comb42) ComboBox4.AddItem Trim(conf.comb43) ComboBox1.Text = ComboBox1.List(0) ComboBox2.Text = ComboBox2.List(0) ComboBox3.Text = ComboBox3.List(0) ComboBox4.Text = ComboBox4.List(0) End If Next z% End Sub Sub agregar() Open archivo For Random As 1 Rem leer el indice, incrementar y grabarlo Get 1, 1, dat ultimo = Val(dat.nombre) If Val(ultimo) = 0 Then ultimo = 1 puntero = ultimo + 1 dat.nombre = puntero Put 1, 1, lib Rem puntero almacena la posicion donde debe grabarse el nuevo registro histo.fecha = Xfecha histo.rol = Xrol histo.caratula = Xcaratula histo.documento = Xdocumento histo.movimiento = Xmovimiento Put 1, puntero, dat Close End Sub |