I have a table that keeps track of data on a per year basis.
For some reason the person who orignally developed it set it up so that the field names contained the year and that with each new year they just added more fields
So the table design would look like this...
Table items
---------
2007department number
2007item varchar
2007sales number
2006department number
2006sales number
2006item varchar
There already exist a form where you can look through another table that contains stuff broken up by department. On that form you hit a button and a new form pops up showing information from that items table for the current year thats relavent to the deparment.
At the moment when the next year rolls around they change the query and reassign the values in the textboxes.
Im pretty sure im not going to be to allowed to redesign the table. So my question is, is there a way to set a controlsource to a field name that has a wildcard in it.
so maybe have yeardepartment as the control source instead of 2007 and somehow have it pull the year from the heading (the heading is a textbox saying 2007)
The layout it like this
Textbox: Year (gets year by Year(Date())) so that its the current year
Textbox: Data (needs to change the column reference when the year is changed)
Textbox: Data (needs to change the column reference when the year is changed)
For some reason the person who orignally developed it set it up so that the field names contained the year and that with each new year they just added more fields
So the table design would look like this...
Table items
---------
2007department number
2007item varchar
2007sales number
2006department number
2006sales number
2006item varchar
There already exist a form where you can look through another table that contains stuff broken up by department. On that form you hit a button and a new form pops up showing information from that items table for the current year thats relavent to the deparment.
At the moment when the next year rolls around they change the query and reassign the values in the textboxes.
Im pretty sure im not going to be to allowed to redesign the table. So my question is, is there a way to set a controlsource to a field name that has a wildcard in it.
so maybe have yeardepartment as the control source instead of 2007 and somehow have it pull the year from the heading (the heading is a textbox saying 2007)
The layout it like this
Textbox: Year (gets year by Year(Date())) so that its the current year
Textbox: Data (needs to change the column reference when the year is changed)
Textbox: Data (needs to change the column reference when the year is changed)