By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,259 Members | 1,690 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,259 IT Pros & Developers. It's quick & easy.

Charts: Change in Y

P: n/a
Hi,
I use Access 2000. I have a linear plot in the database. What would be
the best way to find the change in the highest linear point to the
lowest linear point on the graph? Graph values come from a table. Each
point comes from a different column in the table. A single linear
graph may have from 1 to 15 points. So far I have been using if
statements in unbounded fields in the report...but they are ending up
being really huge.

Thanks
Nov 13 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
va***@hotmail.com (Enterprise) wrote in message news:<e3**************************@posting.google. com>...
Hi,
I use Access 2000. I have a linear plot in the database. What would be
the best way to find the change in the highest linear point to the
lowest linear point on the graph? Graph values come from a table. Each
point comes from a different column in the table. A single linear
graph may have from 1 to 15 points. So far I have been using if
statements in unbounded fields in the report...but they are ending up
being really huge.

Thanks


Shot in the dark, but one thing you could do is something like...

Option Compare Database
Option Explicit

Public Function GetRowAverage(lngRowID As Long) As Double
Dim rs As DAO.Recordset
Dim strSQL As String
Dim intCounter As Integer
Dim dblSum As Double

strSQL = "SELECT * FROM tblNumbers WHERE Autonum=" & lngRowID
Set rs = CurrentDb.OpenRecordset(strSQL, dbOpenSnapshot)

For intCounter = 1 To rs.Fields.Count - 1
dblSum = dblSum + rs.Fields(intCounter).Value

Next intCounter

GetRowAverage = dblSum / (rs.Fields.Count - 1)

rs.Close
Set rs = Nothing
End Function

I would go for a SQL-based solution if possible, though, but you'd
have to union all 15 fields together and then limit the WHERE clauses
to a single RecordID.

SELECT Field1 AS TotalMe
FROM table1
WHERE RecordID=1
UNION ALL
SELECT Field1 AS TotalMe
FROM table1
WHERE RecordID=2

....

SELECT Field15 AS TotalMe
FROM table1
WHERE RecordID=15

and then you could just use a SQL query.
Nov 13 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.