Greetings all!
I've got a problem I'm hoping someone can help out with.
I've got a series of tables that are archived data by year. For example: MyData_2006, MyData_2007 etc.
Now they all use the same exact form to view and edit the data. So what I'm trying to do is create a drop down box that will change the record source of that form based upon what the user chose. So the user will choose the year from the drop down, push the button and the Form will open up with the record source changed to that year.
The problem I'm running into is when it gets to the recordsource line of code I get the error message: Method or data member not found.
When I searched for this on Google it indicates that I was missing the "Microsoft DAO 3.5 (or 3.6) Object Library". However, I'm NOT missing it. It's in my list of available references and is checked. I've got 3.5 & 3.6 available (I've tried them both, but am using 3.6 by default).
So if anyone has any further ideas, I would greatly appreciate it!
-Dale
Below is my code:
Private Sub View_Season_Click()
Dim dbs As Database
Set dbs = CurrentDb
strSeason_Value = Me!Combo4.Column(1)
dbs!Forms!Cost_Sheet.RecordSource = strSeason_Value
DoCmd.OpenForm "Cost_Sheet"
End Sub
I've got a problem I'm hoping someone can help out with.
I've got a series of tables that are archived data by year. For example: MyData_2006, MyData_2007 etc.
Now they all use the same exact form to view and edit the data. So what I'm trying to do is create a drop down box that will change the record source of that form based upon what the user chose. So the user will choose the year from the drop down, push the button and the Form will open up with the record source changed to that year.
The problem I'm running into is when it gets to the recordsource line of code I get the error message: Method or data member not found.
When I searched for this on Google it indicates that I was missing the "Microsoft DAO 3.5 (or 3.6) Object Library". However, I'm NOT missing it. It's in my list of available references and is checked. I've got 3.5 & 3.6 available (I've tried them both, but am using 3.6 by default).
So if anyone has any further ideas, I would greatly appreciate it!
-Dale
Below is my code:
Private Sub View_Season_Click()
Dim dbs As Database
Set dbs = CurrentDb
strSeason_Value = Me!Combo4.Column(1)
dbs!Forms!Cost_Sheet.RecordSource = strSeason_Value
DoCmd.OpenForm "Cost_Sheet"
End Sub