Re: Change of field name causes application to crash



Actually, I can create a simple Sum query and get the same crash. Look at my
reply to Allen, though - the problem is resolved when I change an underlying
UNION ALL query to simply UNION. In this case, there is no chance of
duplicates in the queries underlying the union query (because they already
group on the appropriate fields), so UNION will return the correct results. I
think I have lots more to learn about union queries and why this would happen.

Thanks.

"david@epsomdotcomdotau" wrote:

> I'm really only concerned about controls or object which
> are part of the report. Sometimes when you have a control
> or public variable on the report with a name clash with
> a field, you get an error, shown by #name when the problem
> is a text control. When you get an error, sometimes Access
> crashes.
>
> I am looking to see if there is problem with the Report, rather
> than with the query. So, do you have a problem with the
> DSUM when it is calculated outside the report? Do you
> have a problem with the DSUM if it is calculated in a report
> format event, and the value then written to a label caption?
> Do you have a problem if you replace DSUM with a User
> Defined Function in a standard code module?
>
> This is more of a problem with reports than with forms.
> Access is dynamically rewriting and running that DSUM
> for every record, and if there is a name clash at runtime,
> that might be a source of confusion for Jet.
>
>
> (david)
>
>
> "Brian" <Brian@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> news:74D0E234-5C7D-4DE8-A916-CFE4DF46C366@xxxxxxxxxxxxxxxx
> > This is Access 2003. There are, indeed, other objects with the same name.
> In
> > fact, on one of the forms (not related to the report in question, but
> using
> > the same underlying query), there is a control called ShipNet. However,
> this
> > is also true of several other controls on that form, and there is no
> failure.
> > See also my notes in response to Allen.
> >
> > "david@epsomdotcomdotau" wrote:
> >
> > > Brian, I didn't answer before because the potential answer
> > > was too complex, but now that I see Allen has given a proper
> > > answer, let me add that
> > >
> > > In Access 2000, any error can cause Access to crash, Access
> > > just doesn't catch errors reliably. I haven't spent enough time
> > > in A2K2 or A2K3 to know how much this is still true.
> > >
> > > Also look out for any other control or object called ShipNet.
> > > You can get errors if there are other Access objects with the
> > > same name.
> > >
> > > (david)
> > >
> > > "Brian" <Brian@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> > > news:BDAE6D07-A486-4A62-BC8B-139045CC2A28@xxxxxxxxxxxxxxxx
> > > > 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.
> > >
> > >
> > >
>
>
>
.



Relevant Pages

  • RE: union query for report
    ... I have a report with 14 subreports. ... but the enter parameter value for A1aC display 12 times. ... The other 6 are based on 6 union ... I wondered if the problem would be using the query, qYr2ReviewSample, in the ...
    (microsoft.public.access.reports)
  • RE: Why cant I open a report using VB?
    ... You'll also get a message box telling you the value of the txtID control - ... Run the query to see if it returns any records. ... know that the query is fine, and so is the data that the report is based on. ... intTestID = Forms!frmDrive!Text35.Value ...
    (microsoft.public.access.modulesdaovba)
  • Re: Sum of numbers
    ... Administrator to come in to insure we have this critical report by April. ... You say the union query 'only shows fields from the first table'. ... Do you mean that you want a multicolumn report with all customers' names ...
    (microsoft.public.access.reports)
  • Re: SQL Select Query Help
    ... I should be approaching this as a union and not trying to ... If I type all the rows (pay or deduction) ... > in the case of your report, there IS no logical relationship - so I had to ... > query in chronological order. ...
    (microsoft.public.sqlserver.programming)
  • RE: Why cant I open a report using VB?
    ... Right, plugging the number into the criteria works, so the query itself is ... "Stuart At Work" wrote: ... know that the query is fine, and so is the data that the report is based on. ... is to check that the control that you refer to to populate the variable ...
    (microsoft.public.access.modulesdaovba)

Loading