Access shutting down when accessing saved query

L

LisaDW

Hi!
This is my first time here and everyone appears helpful, so I'm hoping
someone will know the answer to my question.

I have a series of 12 Select queries that I am using in my Access 2002
database, that were created in Access 2000. The idea of the queries is to
take a value & spread it over 12 months, for a period of 5 years. There is a
query to give me 1/12 of the value for each month, using DateAdd to create 5
years past the date started. I am able to run the queries ok, but when I
click on the query in Design mode, Access closes down. I am able to update
other queries in the same database with no problem, so I'm wondering if it
has something to do with the SQL code of the query, using an IIf stmt &
DateAdd functions.

I went to a backup copy of the database, that has all of the queries (but no
local tables), and am able to get into the query, but once I try to edit that
query in the backup database, the same thing happens again - Access closes.

Here is the SQL code: Is there something different between 2000 & 2002 that
would cause this problem? Is the DateAdd function supposed to be constructed
differently in 2002?

Here is a portion of the query - I have deleted some of the many fields from
the query to save room here - I think I have included everything that is
relevant:

Qry_PMonth1
SELECT [tbl_GC-BC4A].[BC_ID] AS Expr3, [tbl_GC-BC4A].[n_period_num] AS
Expr26, [tbl_GC-BC4A].[n_period_value] AS Expr27,
[tbl_GC-BC4A].[d_date_started] AS Expr29,
IIf([tbl_GC-BC4A].[n_period_num]=1,DateAdd("m",0,[tbl_GC-BC4A].[d_date_started]),IIf([tbl_GC-BC4A].[n_period_num]=2,DateAdd("m",12,[tbl_GC-BC4A].[d_date_started]),IIf([tbl_GC-BC4A].[n_period_num]=3,DateAdd("m",24,[tbl_GC-BC4A].[d_date_started]),IIf([tbl_GC-BC4A].[n_period_num]=4,DateAdd("m",36,[tbl_GC-BC4A].[d_date_started]),IIf([tbl_GC-BC4A].[n_period_num]=5,DateAdd("m",48,[tbl_GC-BC4A].[d_date_started]))))))
AS New_Date, ([tbl_GC-BC4A].[Value]/12) AS [Value],
[tbl_GC-BC4A].[n_expense_class_id] AS Expr30
FROM [tbl_GC-BC4A];

Any help will be greatly appreciated!
 
A

Allen Browne

The problem is probably a Name AutoCorrect issue, or else the kind of
corruption that a decompile would fix (since it does call VBA functions, and
you've swapped versions.)

Here's a standard recovery sequence:
http://allenbrowne.com/recover.html
Follow through the steps in order.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top