Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Retrieving most current records

Status
Not open for further replies.

jdwm2310

Technical User
Jul 26, 2001
396
US
Hi Guys,

I want to retrieve the most current set of records. I have a form (Employee A) this form consist of employee's personal information, the form also includes a command button that will open up a form in read only view. (this form is called Purchases). For example, in Employee A.frm I go to John Stuart then I click on the command button to view his Purchases. He has more than one purchases. I want to view the most recent purchase.

Thanks
 
CosmoKramer,

I checked the Max function, but the field that I am interest in is bound, the dmax coding is inserted in the control source.. what should I do?????
 
I do this in one of my applications, but I am using vbscript on an asp page, you might try this:
Code:
 Set maxpurchase = conn.execute("SELECT MAX(Purchase) as max FROM tblpurchases")
Then to retrieve it:
Code:
 maxpurchase("max")
Hope this helps.
 
Where do I put this code, in my preview command button

Set maxpurchase = conn.execute("SELECT MAX(Purchase) as max FROM tblpurchases")

How about this: maxpurchase("max")
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top