Public Con As New Connection Private rs As Result Public Sub Conectar() Con = Connections["con"] If Con = Null Then Message.error("Error al intentar conectarse a la base de datos") Endif End Public Sub cmdGuardar_Click() Dim res As Integer res = Message.Question("Desea Guardar este registro?", "Si", "No") If res = 1 Then rs = Con.Create("Alumnos") rs!Registro = txtRegistro.Text rs!INombre = txtINombre.Text rs!IINombre = txtIINombre.Text rs!IApellido = txtIApellido.Text rs!IIApellido = txtIIApellido.Text rs!Sexo = txtSexo.Text rs.Update Endif End Public Sub Form_Open() Conectar() txtRegistro.SetFocus End