Código:
mi problema es que al querer agregar nuevos datos a la base de datos me da el error '-2147217842' (80040e4e) en tiempo de ejecucion y me señala el Adodc1.recordset.addnewOption Explicit Dim cn As New ADODB.Connection, strCNString As String Dim rs As New ADODB.Recordset Private Sub cmdAgregar_Click() Adodc1.Recordset.AddNew If (cmdAgregar.Caption = "Guardar") Then Adodc1.Refresh Adodc1.Recordset.MoveLast cmdAgregar.Caption = "Agregar" Maskhoraini.Visible = False Maskhorafin.Visible = False combohab.Visible = False cmdModificar.Enabled = True cmdEliminar.Enabled = True Else cmdAgregar.Caption = "Guardar" Maskhoraini.Enabled = True Maskhorafin.Enabled = True combohab.Enabled = True Maskhoraini.Visible = True Maskhorafin.Visible = True combohab.Visible = True Maskhoraini.SetFocus cmdModificar.Enabled = False cmdEliminar.Enabled = False End If Exit Sub cn.Close 'Limpio máscaras Maskhoraini.Mask = "" Maskhoraini.Text = "" Maskhorafin.Mask = "" Maskhorafin.Text = "" Maskhoraini.Mask = "##:##" Maskhorafin.Mask = "##:##" End Sub
si alguien tiene alguna idea por favor explicarme que pasa