View different table info from a form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I was wondering if there was a way to toggle between tables in a form. For
example at the end of the year all information is saved for that year. The
next year starts over in a new table with the same fields for the current
year. Sometimes I have to look up information from the previous year and
would like to know if in my form I could toggle between which year I select
from or do I have to go in and reset the recordsource everytime? Can this
apply to reports as well?

Thank you.
 
Normally, you should leave all your data in a single table and possibly add a
field for YEAR. However, you can use code to change the Record Source of your
form like:

Me.RecordSource = "SELECT * FROM tblLastYear;"
or
Me.RecordSource = "SELECT * FROM [" & Me.lboTables & "];"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top