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
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


0