-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
You can't have any expression in a table. I suspect that you've created
the expression in a query. Your criteria in the DLookup() function is
meaningless because it is comparing a value to itself minus 1. It
should be comparing the DLookUp()'s column value to the main query's
column value. E.g. (in the SQL view):
SELECT
DLookUp("[current kms]", "[Expenses-Tbl-3]", "Expr1=T1.Expr1-1") As
PreviousValue
FROM [Expenses-Tbl-3] As T1
WHERE <criteria>
In the FROM clause, the "As T1" is an alias. The alias is used in the
DLookUp() function to compare the column value the DLookUp() function
reads to the column value the main query reads.
You need to read the Access Help article on the DLookUp() function. An
easy way to get the article is to open the Debug window (Ctrl-G); type
in the function name; put the cursor on the name and hit the F1 key.
--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)
** Respond only to this newsgroup. I DO NOT respond to emails **
-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv
iQA/AwUBSbrdD4echKqOuFEgEQLjRQCfS2Plyn6QFzjdv8YqRPnFKmovuzoAn08e
4PkXPi3AqSeWfnkqEeSz4O7w
=p9pO
-----END PGP SIGNATURE-----
ok, i have created a primary key for my table, but it is an expression. i
have entered the following function and it returns an error. can you help me
fix it?
Expr3: DLookUp("[current kms]";"EXPENSES-TBL-3";" [EXPENSES-TBL-3].Expr1=" &
[EXPENSES-TBL-3].[Expr1]-1)
Ο χÏήστης "MGFoster" ÎγγÏαψε:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Yes, that function can do that. It doesn't matter what sequence the
users enter the data. All tables should have a Primary Key (PK). It
looks like the the PK might be the date, plates and location columns
(fields) if they uniquely identify the rows (records).
Just use the DLookup() function, as described in the KB article, as one
of the columns in a query.
--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)
** Respond only to this newsgroup. I DO NOT respond to emails **
-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv
iQA/AwUBSbphLIechKqOuFEgEQI9JQCfcy1WDzSJxvWf5CiLSOcvwR5FpV4An0Zv
+CF4pqsyQO2bibchfbj1AWJe
=rPoJ
-----END PGP SIGNATURE-----