No the report is based on a crosstab query so therefore they are
groupby
fields, I don't know any other way to display the data in the format I
want
to view it (eg rows and columns spreadsheet style), but I still need
the
report to do some grouping and, for example, not to print the
specialist
against every row but in a header instead.
There also will be calculated control calling other functions (to
calculate
working days etc) but I haven't got that far yet as it keeps failing!
If I
add the Productive group the whole report layout is messing up.
Are you saying I shouldn't be able to do all this?
:
So you can get the report to fail with just 3 grouping levels:
Country
Specialist
Productive (Yes/No type field)
This happens even though:
- the report is bound directly to a table (not a query that is doing
prior
ORDER BY or GROUP BY);
- there is no code in the events of the report (i.e. the report's
HasModule
property os No);
- there are no calculated fields on the report that are calling other
functions.
If so, you have a situation I have not seen.
You have already done a repair, so a bad index is unlikely.
Nevertheless,
you might consider breaking any relation on Country and Specialist,
removing
any indexes on these fields (including hidden indexes), compacting,
and
then
recreating the indexes and relations.
If you have not previously checked that you have SP8 for JET 4 and the
latest service pack for your version of Office, get these from:
http://support.microsoft.com/gp/sp
There was a problem with Access 2002 SP3 throwing the 'No Current
Record'
error in a form after deleting a record, but you can't delete in a
report
so
I doubt that is relevant.
Not sure what else to suggest.
--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Reply to group, rather than allenbrowne at mvps dot org.
After compact and repair its working again but I rebuilt piece by
piece
to
test each thing. The problem seems to lie with the Productive field.
This
is
a Yes/No field and determines whether an activity is deemed
productive
or
non-productive. I wanted the report to group by country first, then
specialist, then on productive activities and totals and
non-productive
activies and totals. Adding the Productive group header messes
everything
up
and the report starts to error with No Current Record
:
Unfortunately as I have started to further build my report the
problem
became
apparent again with no current record. It doesnt produce the jet db
error
though.
It is a complicated report based on a crosstab query and I am
trying
to
add
quite a few grouping levels.
This is getting very frustrating :-(
:
You can definately run into problems with mismatches and
inconsistent
results if the field type and the criteria type don't match.
Using a Date/Time type field, and a Date/Time type value in the
criteria is
highly desirable if that's the kind of data you are dealing with.
In fact, you have to work hard at getting JET 4 to recognise
calculated
date
fields as the right type, and you have to work at getting Access
to
recognise unbound text boxes as dates, so you can get consistent
results.
This article explains how:
Calculated fields misinterpreted
at:
http://allenbrowne.com/ser-45.html
--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Reply to group, rather than allenbrowne at mvps dot org.
It is a text field not a date field. Its default value is set
to:
=Format(DateAdd("m",-1,Date()),"mmmyy")
Then in the query the criteria is Right([reviewdate],2) =
Right([forms]![frm
report menu]![DateFilter],2).
It is done this way as another report uses the DateFilter which
has
these
same values (eg JAN05) stored in a tables text field called
ReportingMonth,
which identify whether a record has been reported on or not and
in
which
month/year if so.
For this new report I have the problem with it filters on
ReviewDate
which
is an actual date field so I think maybe I should change it to
one
of
your
dateserial examples using a date field on the form. I also have
one
called
startdate which defaults to the following Monday's day to print
out
weekly
itineraries. Do you think this is maybe the problem because its
not
an
actual
date field?
:
Okay, so the text box displays the date in mmmyy format.
It might make a difference to the behavior of the reports
whether
this
text
box actually gets assigned a *date*, as in:
Me.DateFilter = DateSerial(Year(Date), Month(Date)-1, 1)
or whether it gets assigned as *string* value, such as:
Me.DateFilter = Format(DateSerial(Year(Date),
Month(Date)-1,
1),
"mmmyy")
--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Reply to group, rather than allenbrowne at mvps dot org.
message
Sorry for the confusion, DateFilter is an unbound text field
on
a
form
(which
is called frm report menu). When the form is opened
DateFilter
is
defaulted
to the current year and month-1 eg at the moment it will
show
JUL05.
I have various reports/queries that use this to filter which
records to
show.
message
Story so far...
I made a new db and imported all objects then followed
your
step by
step
instructions. The problem still occurs so I am now
looking
at
the
recovering
from corruption articles.
One thing, when I imported all the objects to a new db
there
were
pop
up
parameter boxes for datefilter which is one of the
objects
on
the
reports
menu which is used by the problematic query and reports.
I
also
get
the
error
'MS jet database engine does not recognize '[forms]![frm
report
menu]![datefilter]' as a valid field name on my crosstab
queries if
I
don't
put this in as a parameter. Is this related to these
problems
too?
Thanks
Sue
--
Thanks in advance for any help.
Sue
:
The strange looking name Access can't find indicates
that
either:
a) something in the report or its source query refers to
an
object
that
does
not exits, or
b) Access is confused about what is named what.
If the report does work properly after a
compact'n'repair,
then (b)
is
the
likely issue. Typically this happens because of the many
bugs
associated
with Name AutoCorrect in Access, and the corruption they
cause.
To fix the problem, try this sequence:
1. Uncheck the boxes under:
Tools | Options | General | Name AutoCorrect
Explanation of why:
http://allenbrowne.com/bug-03.html
2. Compact the database to get rid of this junk:
Tools | Database Utilities | Compact
3. Close Access. Make a backup copy of the file.
Decompile
the
database
by
entering something like this at the command prompt while
Access is
not
running. It is all one line, and include the quotes:
"c:\Program Files\Microsoft
office\office\msaccess.exe"
/decompile
"c:\MyPath\MyDatabase.mdb"
4. Open Access, and compact again.
5. Open a code window.
Choose References from the Tools menu.
Uncheck any references you do not need.
For a list of the ones you typically need in your
version
of
Access,
see:
http://allenbrowne.com/ser-38.html
6. Still in the code window, choose Compile from the
Debug