Thread: Display last entered record
03-10-04, 02:33 #1Registered User
- Join Date
- Jan 2004
Unanswered: Display last entered record
I have a table "Scores" in which I have the fields "Date" and "Location". I have a form "frmscores" which is used to enter today's scores. The fields on this form are as follows:
1. combo box "cmb_location" for selecting the location,
2. text feild "txt_score" for entering the score and
3. another text field "txt_previous" which displays the last updated score for that location (button cmdSave to save the record).
Now when the user selects a particular location, I have to write a code in the after_update event of the Combo so that it displays me the previous score of that location in the "txt_previous". I have tried using clause where location=cmb_location.value and date=date-1 but this will work only if there is a entry everyday and will not work for saturday and sunday(when there will be no entry).
I have to write a code to display the last updated score (last entered score) for the location selected. Please help?sahil
03-10-04, 03:29 #2Registered User
- Join Date
- Sep 2003
- The extremely Royal borough of Kensington, London
from tableA ta
where date = (select max(date) from tableA where location = ta.location AND date < [dateParam])Bessie Braddock: Winston, you are drunk!
Churchill: And Madam, you are ugly. And tomorrow, I'll be sober, and you will still be ugly.