Results 1 to 7 of 7
  1. #1
    Join Date
    Oct 2003
    Location
    Perth WA
    Posts
    8

    Unanswered: Automate yearly change of recordsource.

    I have one form and several yearly tables. How can i automate the form to change it's recordsource in conjunction with the sytem date roll-over at year end?

  2. #2
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713

    Re: Automate yearly change of recordsource.

    Originally posted by Rory Popa
    I have one form and several yearly tables. How can i automate the form to change it's recordsource in conjunction with the sytem date roll-over at year end?
    What do you mean? Did you hardcode the recordsource in the form?

  3. #3
    Join Date
    Oct 2003
    Location
    Perth WA
    Posts
    8

    Re: Automate yearly change of recordsource.

    Originally posted by M Owen
    What do you mean? Did you hardcode the recordsource in the form?
    No, the forms recordsource is dependent upon the value of a hidden field that draws its value from a combobox. The combobox is on another form that permits the user to select the data year. Rather than have the user select the forms recordsource at each year end i was hoping it could be automated with the system date and simply change as the date rolls over to a new year.

  4. #4
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Ok ... Well that is simple. On your Form_Open or Form_Load generate the appropriate query for your recordsource using either Now or Date ...

  5. #5
    Join Date
    Oct 2003
    Location
    Perth WA
    Posts
    8
    I am still a little unclear how that will work. Presently i have 10 tables from 2003 - 2012 but one form. How will the query identify which table to source and at what date when the form opens?

  6. #6
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Originally posted by Rory Popa
    I am still a little unclear how that will work. Presently i have 10 tables from 2003 - 2012 but one form. How will the query identify which table to source and at what date when the form opens?
    Well in this case it's still relatively easy ... What you build is the name of the table that the form will be bound to on the fly ...

  7. #7
    Join Date
    Oct 2003
    Location
    Perth WA
    Posts
    8
    Ok, i will give that a go.

    Thanks.......

Posting Permissions

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