Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2003
    Posts
    65

    Question Unanswered: Open the form showing the most recent data???

    Hi there,

    I have a form , let's call it Flyer, used to enter the programs for a private school. It has controls like "Year", "Season", "ProgramStartDate", "ProgramEndDate", etc. So the data would look like this:
    ---
    Year - 2003
    Season - Fall
    ProgramStartDate - 15-Sep-03
    ProgramEndDate - 23-Dec-03
    ---
    I want to put some VB code behind OnOpen event of the form, which will make sure to display the "Flyer" with the most recent data - the one that has just started, or is coming up. I think I could not use FlyerId for this purpose, because if the user decides to enter some data from previous years, then the last entries in the table would hold information on, say a year ago.

    To make it short, I need a way to examine the ProgramStartingDate and ProgramEndDate in relation to the current date and then locate the specific FlyerId and open the form with this FlyerId.

    Am I right in my approach, or there is a simpler solution? Any help with the code would be very much appreciated.

    Thanks,
    Jazz

  2. #2
    Join Date
    Feb 2003
    Location
    Auckland, NZ
    Posts
    150
    I your form datasource you can Sort the records in the query is this an option?
    JJ Kennedy
    Double J IT Solutions
    www.doublejit.co.nz

    VB 6, VB.NET, ASP.NET, MS SQL Server, MySQL, MS Access

Posting Permissions

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