G
Guest
On a report section footer, I have text boxes that each calculate a single
value as follows:
InventoryArrived
=Val(nz(DSum("[ArriveNet]","[LookupInventoryCombinedNet]","[CommodityID] = "
& [CommodityID] & " and [UnitID] = " & [UnitID] & " and [Active]"),0))
InventoryShipped
=Val(nz(DSum("[ShipNet]","[LookupInventoryCombinedNet]","[CommodityID] = " &
[CommodityID] & " and [UnitID] = " & [UnitID] & " and [Active]"),0))
LookupInventoryCombinedNet is the name of a query. ArriveNet and ShipNet are
two fields in that query. Both are calculated approximately the same in the
query: ArriveNet = ArriveIn - ArriveOut; ShipNet = ShipIn - ShipOut.
The anomaly is that the "ShipNet" in the InventoryShipped text box causes
Access to crash when running the report. If I change its name to "ShipNets",
"ABCDEFGH", or anything else in both the query and the calculated control
source above, it works.
Now, what is so special about the field name "ShipNet"? I have
ascertained/tried the following:
-It also works if I leave it as the same name but remove the "and Active"
filter at the end of the DSum.
-"ShipNet" does not appear twice in the query.
-The query runs fine by itself.
-I have compacted/repaired many times.
-I have removed this field from the query, saved the query, then recreated
the field.
-The crash occurs also if I create another query that Sums this field, but
again ONLY if I use ShipNet as the field name.
-I have copied the SQL, deleted the query, and recreated the query using the
same SQL.
The only hint I have to offer is that this query is at the top of a chain of
queries, each built on the one before:
Query6 (this one), whose source is Query5, whose source is Query4, a union
query of six parallel Query3's, each of which is based on Query2, whose
source is Query1.
However, I can run these at any level run just fine and plenty fast enough,
and all other fields work just fine except ShipNet.
value as follows:
InventoryArrived
=Val(nz(DSum("[ArriveNet]","[LookupInventoryCombinedNet]","[CommodityID] = "
& [CommodityID] & " and [UnitID] = " & [UnitID] & " and [Active]"),0))
InventoryShipped
=Val(nz(DSum("[ShipNet]","[LookupInventoryCombinedNet]","[CommodityID] = " &
[CommodityID] & " and [UnitID] = " & [UnitID] & " and [Active]"),0))
LookupInventoryCombinedNet is the name of a query. ArriveNet and ShipNet are
two fields in that query. Both are calculated approximately the same in the
query: ArriveNet = ArriveIn - ArriveOut; ShipNet = ShipIn - ShipOut.
The anomaly is that the "ShipNet" in the InventoryShipped text box causes
Access to crash when running the report. If I change its name to "ShipNets",
"ABCDEFGH", or anything else in both the query and the calculated control
source above, it works.
Now, what is so special about the field name "ShipNet"? I have
ascertained/tried the following:
-It also works if I leave it as the same name but remove the "and Active"
filter at the end of the DSum.
-"ShipNet" does not appear twice in the query.
-The query runs fine by itself.
-I have compacted/repaired many times.
-I have removed this field from the query, saved the query, then recreated
the field.
-The crash occurs also if I create another query that Sums this field, but
again ONLY if I use ShipNet as the field name.
-I have copied the SQL, deleted the query, and recreated the query using the
same SQL.
The only hint I have to offer is that this query is at the top of a chain of
queries, each built on the one before:
Query6 (this one), whose source is Query5, whose source is Query4, a union
query of six parallel Query3's, each of which is based on Query2, whose
source is Query1.
However, I can run these at any level run just fine and plenty fast enough,
and all other fields work just fine except ShipNet.