Dlookup and DMax and DCount

N

nybaseball22

Hello. I have a subform that I am trying to have count the number of
records in a query and then list the top two items in text boxes. I
have tried to use a DMax and Dlookup function, but nothing seems to
work. Does anyone have any idea how I might get this to work?

Thanks
 
A

Arvin Meyer [MVP]

Write a query that sorts on the column that you consider to have the top 2
items, using the TOP predicate in your query, like:

SELECT TOP 2 DateRcvd, MemberName, Amount
FROM tblPayment
ORDER BY DateRcvd DESC;

Use that query as the recordsource of your subform.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Using Max or DMax in DLookUp criteria? 1
Access Dcount function in access 0
Access Dcount (multiple criteria) 3
Access 2007 Dlookup function 0
Creating a function? 13
DMax/DLookup help 3
Is This Good? 13
Using subform's recordset in DMax call? 6

Top