Compacting messed me up?

  • Thread starter Thread starter Mark R
  • Start date Start date
M

Mark R

It seems like after I did a compact and repair,
all of a sudden my REPORT1 starts with record_ID 68
instead of record_ID 44.


ACCESS 2002 (10.2627.etc)
REPORT1 is comprised of some controls that go directly to
MAINTABLE, but also has almost a dozen smaller subreports,
some of which use reports. as a source, some forms. some
of the forms. are DATASHEET format, one is tabular, some
are columnar.
Funny things:
some of the sub-reports can start with record_ID 44
just fine if I run them independantly, others start with
record_ID 68
MAINTABLE seems uncorrupted - I can find all the
test data for all records
REPORT1 seems in tact otherwise, no other
malfunctions.........just can't point to record_IDs prior
to 68


SO I compacted again, and again, and again

and all of a sudden the REPORT1 started with record_ID 51
more compacts and repairs do not alter this, it remains
51, and all the above funny things hold true.
Can someone help me figure out what is going on?
 
Do you have primary key defined on each table?
Do you have Sorting & Grouping defined for the report?
 
Yes, No

I never had a problem before, I have been building this application for some
time. It is nothing like that.

I just tried creating a simple three field form for MAIN TABLE. No problem,
it started with record_ID 44.

Then I saved that test form as a REPORT.

Guess what? The report starts with record_ID 51 !!!
whAT IS GOING ON?
 
Hi,
Unless you're telling Access how to sort the result set, usually with an Order By in your
query that feeds the form, the records are not guaranteed to be in any particular order.
This is true for any relational database, not just Jet.
 
so what you mean is:

The Order by property must have been set to ID at one
earlier point in time and some how I inadvertantly either
turned off the Order BY or else erased the "ID" from
ORDER? and therefore the report is just sorting in a
different order?

Am I right, is that what you mean?

I think so..........after McDermott's too brief answer, I
just stared at properties and started to play with ORDER
BY and it seemed to correct itself. I was initially
thrown by not having a "sort" problem with new forms and
only the report module, but then I figured FORMS must
drive off the table primary key and report just plain does
not. Is this correct?

thanks for your prior , more complete response.
-----Original Message-----
Hi,
Unless you're telling Access how to sort the result set,
usually with an Order By in your
query that feeds the form, the records are not guaranteed to be in any particular order.
This is true for any relational database, not just Jet.

--
HTH
Dan Artuso, Access MVP


"mark R" <mark (e-mail address removed)> wrote in
message (e-mail address removed)...
 
I usually use the Sorting and Grouping button to define a sort order for a
report.
Any OrderBy clause in your underlying query will be ignored by a report.

For a form, however, the OrderBy clause of your underlying query will
determine the sort order.
If there's no OrderBy clause, any indexes defined on the table (especially
the Primary Key) will be used.

HTH
- Turtle
 
Back
Top