Access - Se requiere un objeto

 
Vista:

Se requiere un objeto

Publicado por Lupita (1 intervención) el 25/06/2013 22:44:59
Me sale que se requiere un objeto pero no se en donde "rstDetallesdeventa.AddNew"

Private dbtienda As Database
Private rstClientes As Recordset
Private rstempleados As Recordset
Private rstInformacion As Recordset
Private rstProveedores As Recordset
Private rstProductos As Recordset
Private rstVentas As Recordset
Private rstDetallesdeventas As Recordset
Dim nsubtotal As Double

Private Sub Form_Load()
Set dbtienda = OpenDatabase(App.Path & "\Tienda.mdb")
Set rstClientes = dbtienda.OpenRecordset("clientes")
rstClientes.Index = "keyclientes"
Set rstempleados = dbtienda.OpenRecordset("empleados")
rstempleados.Index = "Keyempleados"
Set rstInformacion = dbtienda.OpenRecordset("informacion")
rstInformacion.Index = "keyinformacion"
Set rstProductos = dbtienda.OpenRecordset("productos")
rstProductos.Index = "Keyproductos"
Set rstProveedores = dbtienda.OpenRecordset("proveedores")
rstProveedores.Index = "keyproveedores"
Set rstVentas = dbtienda.OpenRecordset("Ventas")
Set rstDetallesdeventa = dbtienda.OpenRecordset("Detallesdeventa")
End Sub
Sub guardar()
rstVentas.AddNew
rstVentas!Numerofactura = Val(Txtnumfac)
rstVentas!Codigoclientes = TxtCodigoclie
rstVentas!Codigoempleados = TxtCodigoem
rstVentas!Fecha = CDate(TxtFecha)
rstVentas!Productos = txtcodigoproducto
rstVentas!Cantidad = Val(TxtCantidad)
rstVentas.Update
For I = 0 To LstCodigo.ListCount - 1
rstDetallesdeventa.AddNew
rstDetallesdeventa!Producto = LstCodigo.List(I)
rstDetallesdeventa!Folio = Val(Txtnumfac)
rstDetallesdeventa!Cantidad = Val(LstCantidad.List(I))
rstDetallesdeventa.Update
Next
End Sub
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

Se requiere un objeto

Publicado por 2PL (461 intervenciones) el 25/06/2013 22:56:56
Private rstDetallesdeventas As Recordset
Set rstDetallesdeventa = dbtienda.OpenRecordset("Detallesdeventa")
Te falta una ese en Set rstDetallesdeventa
Asi es correcto Set rstDetallesdeventas = dbtienda.OpenRecordset("Detallesdeventa")
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar