Ayuda Modificar
Publicado por Víctor (12 intervenciones) el 14/08/2007 06:59:56
Hola, necesito ayuda.
Tengo un formulario, desde donde guardo datos a una BD Access, y hasta ahí no tengo problemas, pero cuando edito un dato ingresado y le hago midificaciones, al dar al boton guardar me da un error de TablaLuz Update
Private Sub CmdEditar_Click()
Dim Buscar
Dim RESP As Integer
Buscar = InputBox("Nº DE CLIENTE A BUSCAR")
TablaLuz.Index = ("indice")
TablaLuz.Seek "=", Buscar
If Not TablaLuz.NoMatch Then
VerCampos
Else
RESP = MsgBox("Si no recuerda el Nº de Cliente" & vbCrLf & "¿Quiere Buscarlo en Clientes?", vbQuestion + vbYesNo + vbDefaultButton1)
If RESP = 6 Then
GAS1.Show
End If
End If
End Sub
____________________________________________________________________
Private Sub CmdGuardar_Click()
TablaLuz.Index = ("indice")
TablaLuz.Seek "=", txCodigo
If Not TablaLuz.NoMatch Then
MsgBox "Ya existe un registro con este Codigo", vbInformation, "Guardar"
Exit Sub
Else
TablaLuz.AddNew
TablaLuz("CLIENTE") = txCliente
TablaLuz("MEDIDOR") = txMedidor
TablaLuz("PROPIETARIO") = txPropietario
TablaLuz("RUT") = txRut
TablaLuz("DIRECCION") = txDireccion
TablaLuz("NUMERO") = txNumero
TablaLuz("LOTEO") = txLoteo
TablaLuz("FECHA") = txEntrega
TablaLuz("CONSUMO") = txConsumo
TablaLuz("OBRA") = TxObra
TablaLuz.Update 'EN ESTA LINEA ME DA EL ERROR
End If
txCliente.Text = ""
txMedidor.Text = ""
txPropietario.Text = ""
txRut.Text = ""
txDireccion.Text = ""
txNumero.Text = ""
txLoteo.Text = ""
txEntrega.Text = ""
txConsumo.Text = ""
TxObra.Text = ""
txCliente.SetFocus
End Sub
Por favor si alguien me puede ayudar, le agradezco desde ya.
Víctor
Tengo un formulario, desde donde guardo datos a una BD Access, y hasta ahí no tengo problemas, pero cuando edito un dato ingresado y le hago midificaciones, al dar al boton guardar me da un error de TablaLuz Update
Private Sub CmdEditar_Click()
Dim Buscar
Dim RESP As Integer
Buscar = InputBox("Nº DE CLIENTE A BUSCAR")
TablaLuz.Index = ("indice")
TablaLuz.Seek "=", Buscar
If Not TablaLuz.NoMatch Then
VerCampos
Else
RESP = MsgBox("Si no recuerda el Nº de Cliente" & vbCrLf & "¿Quiere Buscarlo en Clientes?", vbQuestion + vbYesNo + vbDefaultButton1)
If RESP = 6 Then
GAS1.Show
End If
End If
End Sub
____________________________________________________________________
Private Sub CmdGuardar_Click()
TablaLuz.Index = ("indice")
TablaLuz.Seek "=", txCodigo
If Not TablaLuz.NoMatch Then
MsgBox "Ya existe un registro con este Codigo", vbInformation, "Guardar"
Exit Sub
Else
TablaLuz.AddNew
TablaLuz("CLIENTE") = txCliente
TablaLuz("MEDIDOR") = txMedidor
TablaLuz("PROPIETARIO") = txPropietario
TablaLuz("RUT") = txRut
TablaLuz("DIRECCION") = txDireccion
TablaLuz("NUMERO") = txNumero
TablaLuz("LOTEO") = txLoteo
TablaLuz("FECHA") = txEntrega
TablaLuz("CONSUMO") = txConsumo
TablaLuz("OBRA") = TxObra
TablaLuz.Update 'EN ESTA LINEA ME DA EL ERROR
End If
txCliente.Text = ""
txMedidor.Text = ""
txPropietario.Text = ""
txRut.Text = ""
txDireccion.Text = ""
txNumero.Text = ""
txLoteo.Text = ""
txEntrega.Text = ""
txConsumo.Text = ""
TxObra.Text = ""
txCliente.SetFocus
End Sub
Por favor si alguien me puede ayudar, le agradezco desde ya.
Víctor
Valora esta pregunta


0