Hi, Alvin.
How and where do I verify that Info?
You'll need to manually verify the Jet service pack. Open Windows explorer
and find the msjet40.dll file. The default location is:
C:\WINDOWS\system32\msjet40.dll
Right-click on the file name and select Properties from the pop-up menu to
open the Properties dialog window. Select the "Version" tab. Msjet40.dll
should be version 4.0.8618.0 for your operating system. (In case anyone else
is wondering, for Windows 2000 msjet40.dll should be version 4.0.9025.0.)
You can also manually check the Microsoft Access executable version number
or use VBA code to find it. The default location for the Microsoft Access
executable is:
C:\Program Files\Microsoft Office\OFFICE<version#>\MSAccess.EXE
Please see the following Web pages:
Retrieve the Microsoft Access executable version number:
http://www.mvps.org/access/api/api0065.htm
Download, installl and run the MDAC Component Checker:
http://www.microsoft.com/downloads/...f6-4a21-4b43-bf53-14332ef092c9&displaylang=en
HTH.
Gunny
See
http://www.QBuilt.com for all your database needs.
See
http://www.Access.QBuilt.com for Microsoft Access tips.
(Please remove ZERO_SPAM from my reply E-mail address so that a message will
be forwarded to me.)
- - -
If my answer has helped you, please sign in and answer yes to the question
"Did this post answer your question?" at the bottom of the message, which
adds your question and the answers to the database of answers. Remember that
questions answered the quickest are often from those who have a history of
rewarding the contributors who have taken the time to answer questions
correctly.
:
How and where do I verify that Info?
:
I'm sorry, I'm using access 2000 and windows XP
:
Hi, Alvin.
It gives me the following error when I try to view the query after and only
after I try to generate a report with it.
The query is too complex to be opened in the QBE grid. It should be
viewable in the SQL View pane, though. However, there should be no
alterations to the query's SQL statement due to merely using the query itself
as a Record Source for either a report or a form, so I'm not sure why you are
being informed that the inline view can't be found. Are you copying this SQL
elsewhere, such as the Record Source Property for either the report or form
and, after attempting to run this report or form, get this error message? Or
perhaps you are using an older version of Access that wasn't capable of
inline views, and I've forgotten about this since I haven't tried to use an
inline view in your version in quite some time? (I'm using Access 2003.
Which version are you using?) As I recall, Jet 3.5 did some screwy things
with SQL when the query was saved. So much so that a copy/paste of the exact
same SQL into a new query would prevent the new query from running without
errors, even when the original ran just fine.
That gives me an idea. Try this: copy and paste the following into a new
query's SQL View pane:
SELECT W1.MatingOrderID, W2.LogDate, W2.Weight,
(W2.Weight - W1.Weight) AS WeightGain, W2.Unit
FROM (SELECT MatingOrderID, MIN(LogDate) AS StartDate
FROM tblWeights
GROUP BY MatingOrderID) AS Q
INNER JOIN (tblWeights AS W1
INNER JOIN tblWeights AS W2 ON W1.WeightID < W2.WeightID)
ON Q.MatingOrderID = W1.MatingOrderID
WHERE ((Q.StartDate = W1.LogDate) AND (Q.MatingOrderID = W2.MatingOrderID))
GROUP BY W1.MatingOrderID, W1.LogDate, W2.LogDate, W2.Weight,
(W2.Weight - W1.Weight), Q.StartDate, W2.Unit
ORDER BY W2.LogDate;
Save the query, but don't close it. Now create your report or form using
the Wizard and select the name of this new query as the data source. When
finished creating and viewing the new report, open this query in Datasheet
View again. Does it open without error? If so, close it, then open it again
and see whether you get the error.
You may be having trouble with Jet's manipulation of the inline view (those
brackets and the period that Jet replace the opening and closing parentheses
with for the inline view -- that "Q" subquery).
Is there anyway to do this on the actual form where I enter the weight info?
No. This query is a nonupdateable query because of the aggregate function
and the grouping involved. You'll need a simpler data entry form for
entering these records: just the MatingOrderID, LogDate, Weight, and Unit.
HTH.
Gunny
See
http://www.QBuilt.com for all your database needs.
See
http://www.Access.QBuilt.com for Microsoft Access tips.
(Please remove ZERO_SPAM from my reply E-mail address so that a message will
be forwarded to me.)
- - -
If my answer has helped you, please sign in and answer yes to the question
"Did this post answer your question?" at the bottom of the message, which
adds your question and the answers to the database of answers. Remember that
questions answered the quickest are often from those who have a history of
rewarding the contributors who have taken the time to answer questions
correctly.
:
Your right it is a little complex. Just a little note, I am completetly self
taught with no schooling on vb code or anything of the like. But I have
completed all changes you suggested and the Query works until I try nto make
a report with it or a form in datasheet view. When I attempt this I can go
back to the query and it doesn't work after I try to make a report or form
with it. Here is the SQL.
=====================
SELECT W1.MatingOrderID, W2.LogDate, W2.Weight, (W2.Weight - W1.Weight) AS
WeightGain, W2.Unit
FROM [SELECT MatingOrderID, MIN(LogDate) AS StartDate
FROM tblWeights
GROUP BY MatingOrderID]. AS Q INNER JOIN (tblWeights AS W1 INNER JOIN
tblWeights AS W2 ON W1.WeightID < W2.WeightID) ON Q.MatingOrderID =
W1.MatingOrderID
WHERE ((Q.StartDate = W1.LogDate) AND (Q.MatingOrderID = W2.MatingOrderID))
GROUP BY W1.MatingOrderID, W1.LogDate, W2.LogDate, W2.Weight, (W2.Weight -
W1.Weight), Q.StartDate, W2.Unit
ORDER BY W2.LogDate;
========================
It gives me the following error when I try to view the query after and only
after I try to generate a report with it.
=====Error message============
The Microsoft Jet database engine cannot find the input table or query
'Select MatingOrderID, Min(LogDate) AS
StartDate FROM tblWeights GROUP BY MatingOrderID'. Make Sure it
exists and that its name is spelled
correctly.
=====End Error Massage=====
Is there anyway to do this on the actual form where I enter the weight info?
Like I said the Query works fine until I attempt to make a Report with it or
a Form.
Thank you for your help and patience
:
I'm sorry, I forgot to send my current SQL. Here it is
========================
SELECT Weight.WeightID, Weight.MatingOrderID, Weight.Date, Weight.Weight
FROM Weight
GROUP BY Weight.WeightID, Weight.MatingOrderID, Weight.Date, Weight.Weight;
========================
:
Hi, Alvin.
In the report instead of having a running sum is there a way to have a
running subtraction so I can show the amount of weight gain
One needs to do this calculation in the query that will be used as the
Record Source for the report. In the following example of calculating the
accummulative weight gain (or loss) for each animal, the table uses the
following structure:
Table Name: tblAnimalWeights
1.) ID, AutoNumber, primary key
2.) AnimID, Number, foreign key to tblAnimals (to identify individual
animal records)
3.) Weight, Number
4.) Unit, Text (measurement: lbs., oz., et cetera)
5.) LogDate, Date/Time (date weight recorded)
Example query:
SELECT W1.AnimID, W2.LogDate, W2.Weight,
(W2.Weight - W1.Weight) AS WeightGain, W2.Unit
FROM (SELECT AnimID, MIN(LogDate) AS StartDate
FROM tblAnimalWeights
GROUP BY AnimID) AS Q
INNER JOIN (tblAnimalWeights AS W1
INNER JOIN tblAnimalWeights AS W2 ON W1.ID < W2.ID) ON Q.AnimID = W1.AnimID
WHERE ((Q.StartDate = W1.LogDate) AND (Q.AnimID = W2.AnimID))
GROUP BY W1.AnimID, W1.LogDate, W2.LogDate,
W2.Weight, (W2.Weight - W1.Weight), Q.StartDate, W2.Unit
ORDER BY W2.LogDate;
... where WeightGain is the accumulated weight gain (or loss).
HTH.
Gunny
See
http://www.QBuilt.com for all your database needs.
See
http://www.Access.QBuilt.com for Microsoft Access tips.
(Please remove ZERO_SPAM from my reply E-mail address so that a message will
be forwarded to me.)
- - -
If my answer has helped you, please sign in and answer yes to the question
"Did this post answer your question?" at the bottom of the message, which
adds your question and the answers to the database of answers. Remember that
questions answered the quickest are often from those who have a history of
rewarding the contributors who have taken the time to answer questions
correctly.
:
I have a weight Report that shows specific Dates and weights of animals.
In the report instead of having a running sum is there a way to have a
running subtraction so I can show the amount of weight gain, In Other words
say I have the following
Date Weight
9/3/05 18 oz
9/23/05 40 oz
A running sum shows the following
Date Weight Sum
9/3/05 18 oz 0
9/23/05 40 oz 58
I want it to show like the following instead of the way it is above.
Date Weight Weight Gain
9/3/05 18 oz 0
9/23/05 40 oz 22
Thanks for any Ideas
Alvin