Results 1 to 2 of 2
  1. #1
    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?

  2. #2
    Join Date
    Sep 2003
    The extremely Royal borough of Kensington, London
    Select *
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts