I have the following event that is doing ok in access 2000
but for some reason it is not working fine in access XP.
I'm pasting the code here, please let me know if I have to change something:
Dim donde As String
Dim donde2 As String
Dim rstlineas As Recordset
Dim strdisp As String
Set db = CurrentDb()
db.Execute ("INSERT INTO LineasFacturas ( NumeroFactura,IdProveedor, CodPlanta, Tamaño, Descripcion, PrecUnitario, Cantidad, CodNauca, Tip ) " _
& " SELECT DISTINCTROW " & Form_FrmEncFactura.NumeroFactura & ",LinListasEmpaque.IdProveedor, LinListasEmpaque.CodPlanta, LinListasEmpaque.Tamaño, LinListasEmpaque.Descripcion, LinListasEmpaque.PrecUnitario, Sum(LinListasEmpaque.Cantidad) AS [Suma De cantidad], LinListasEmpaque.CodNauca, LinListasEmpaque.Tip" _
& " FROM LinListasEmpaque" _
& " WHERE (((LinListasEmpaque.NoListaEmpaque)= " & Form_FrmEncFactura.NoListaEmpaque & ")" _
& " GROUP BY LinListasEmpaque.IdProveedor, LinListasEmpaque.CodPlanta, LinListasEmpaque.Tamaño, LinListasEmpaque.Descripcion, LinListasEmpaque.PrecUnitario, LinListasEmpaque.CodNauca, LinListasEmpaque.Tip, LinListasEmpaque.NoListaEmpaque" _
Form_FrmEncFactura.Requery
Form_FrmSubLineasFacturas.Requery
Thanks in advanced for your help.
but for some reason it is not working fine in access XP.
I'm pasting the code here, please let me know if I have to change something:
Dim donde As String
Dim donde2 As String
Dim rstlineas As Recordset
Dim strdisp As String
Set db = CurrentDb()
db.Execute ("INSERT INTO LineasFacturas ( NumeroFactura,IdProveedor, CodPlanta, Tamaño, Descripcion, PrecUnitario, Cantidad, CodNauca, Tip ) " _
& " SELECT DISTINCTROW " & Form_FrmEncFactura.NumeroFactura & ",LinListasEmpaque.IdProveedor, LinListasEmpaque.CodPlanta, LinListasEmpaque.Tamaño, LinListasEmpaque.Descripcion, LinListasEmpaque.PrecUnitario, Sum(LinListasEmpaque.Cantidad) AS [Suma De cantidad], LinListasEmpaque.CodNauca, LinListasEmpaque.Tip" _
& " FROM LinListasEmpaque" _
& " WHERE (((LinListasEmpaque.NoListaEmpaque)= " & Form_FrmEncFactura.NoListaEmpaque & ")" _
& " GROUP BY LinListasEmpaque.IdProveedor, LinListasEmpaque.CodPlanta, LinListasEmpaque.Tamaño, LinListasEmpaque.Descripcion, LinListasEmpaque.PrecUnitario, LinListasEmpaque.CodNauca, LinListasEmpaque.Tip, LinListasEmpaque.NoListaEmpaque" _
Form_FrmEncFactura.Requery
Form_FrmSubLineasFacturas.Requery
Thanks in advanced for your help.