crash ??

  • Thread starter Thread starter Miranda
  • Start date Start date
M

Miranda

hi,

i'm working on a report at the moment. I'm using the following query for a
subreports control source:

SELECT getDatePeriod.theDate, A.EquipType, A.numberUsed, A.dateUsed,
A.sheetNumber, A.jobDesc, A.siteorig, A.purchaseOrderNum, (SELECT TOP 1
equipment.cost FROM equipment WHERE (((equipment.Equipment)=A.EquipType) AND
((A.dateUsed)>=[equipment].[dateEffective])) ORDER BY
equipment.DateEffective DESC) AS Expr1, (Expr1*A.numberUsed) AS Expr2
FROM getDatePeriod INNER JOIN A ON getDatePeriod.theDate=A.dateUsed;


everything works fine until I add a calculated control - Sum(expr2). I then
get an error saying microsoft access has experienced an error and must shut
down. i've tried using this control on a number of reports and it always
crashes. When the backup is opened, the data has been lost

does anyone know why this would be happening?

thanks, miranda
 
Miranda said:
i'm working on a report at the moment. I'm using the following query for a
subreports control source:

SELECT getDatePeriod.theDate, A.EquipType, A.numberUsed, A.dateUsed,
A.sheetNumber, A.jobDesc, A.siteorig, A.purchaseOrderNum, (SELECT TOP 1
equipment.cost FROM equipment WHERE (((equipment.Equipment)=A.EquipType) AND
((A.dateUsed)>=[equipment].[dateEffective])) ORDER BY
equipment.DateEffective DESC) AS Expr1, (Expr1*A.numberUsed) AS Expr2
FROM getDatePeriod INNER JOIN A ON getDatePeriod.theDate=A.dateUsed;


everything works fine until I add a calculated control - Sum(expr2). I then
get an error saying microsoft access has experienced an error and must shut
down. i've tried using this control on a number of reports and it always
crashes. When the backup is opened, the data has been lost

does anyone know why this would be happening?


In broad, general terms, any program that crashes is because
of a bug, not yours, but Access's. You should get an error
message, not a crash.

OTOH, it is a known issue that reports that use a record
source query that includes a subquery AND also use Sorting
and Grouping and/or aggregate functions will generate an
error message. Maybe Access's bug is in the code they use
to catch that situation and display the message you didn't
get a chance to see.

This is going to sound really stupid, but you might want to
try it anyway. Add some more glop to your query to make it
so complicated that Access has to go down a different path
to deal with it. What I've done is add the following to the
end of your original query.

UNION ALL
SELECT 1,2,3,4,5, ...
FROM anylittle table
WHERE False

Just make sure the number of fields in the above is the same
as in your original query.

I did say it would look pretty dumb, didn't I?
 
Back
Top