G
g
Hi all,
Here is the scenario, I have two form that run the same query and the
criteria is base on the value on each form text field. As previously
suggested, I should use a module to do this & the here is the code:
Public Function GetValue(strCtrl As String)
GetValue = Screen.ActiveForm.Controls(strCtrl)
End Function
This code will get the value from Forms!Form1.CtrName And
Forms!Form2.CtrName w/c ever is Active. The data in the query that being
filtered is formatted date using Format([MyDate],"yyyy").
It looks like this in my query
YearPicked: Format([MyDate],"yyyy")
Expression
GetValue("CtrName")
It works fine if the value in CtrName will be a single year ex: 2007 & if
filtered only year 2007.Now what if I wanted to get from 2007 up to 2008? How
will I do that on my text field CtrName. To give you more details the text
field at CtrName is control by button. If button1 selected the field will
filed with 2007, button2 2008 and so on.
I hope you guys understand what I'm trying to do.
Here is the scenario, I have two form that run the same query and the
criteria is base on the value on each form text field. As previously
suggested, I should use a module to do this & the here is the code:
Public Function GetValue(strCtrl As String)
GetValue = Screen.ActiveForm.Controls(strCtrl)
End Function
This code will get the value from Forms!Form1.CtrName And
Forms!Form2.CtrName w/c ever is Active. The data in the query that being
filtered is formatted date using Format([MyDate],"yyyy").
It looks like this in my query
YearPicked: Format([MyDate],"yyyy")
Expression
GetValue("CtrName")
It works fine if the value in CtrName will be a single year ex: 2007 & if
filtered only year 2007.Now what if I wanted to get from 2007 up to 2008? How
will I do that on my text field CtrName. To give you more details the text
field at CtrName is control by button. If button1 selected the field will
filed with 2007, button2 2008 and so on.
I hope you guys understand what I'm trying to do.