Background:
I have a table of fields each field representing a month (Jan, Feb,
Mar...). These are not a date field but more of a bucket to hold
labor actuals. Along with the months their is another field for
year. Looking at the table you can see which month and which year the
hours belong to but since the month buckets are not actual dates it is
hard to write certain criteria's that represent dates. I have linked
to a suppliers database and that is why it is this way (not something
i created).
Problem:
What i need is to write a parameter function that would allow me to
see only the dates that are greater than a parameter value.
My not so good VB skills solution (need help finishing):
I thought that i could do a select case that would look something like
this. I would have a combo box for month (cboMonth) and combo box for
year (cboYear).
Case1: Jan+Feb+Mar+Apr...
Case2: Feb+Mar+Apr+May...
Case3: Mar+Apr+May+Jun...
Case4: Apr+May+Jun+Jul...
If CboMonth = "Jan" then
Case1 where [Year] >= cboYear
If CboMonth = "Feb" then
Case2 where year = cboYear + Case1 where [year] cboYear
If CboMonth = "Mar" then
Case3 where year =cboYear + Case1 where [year] cboYear
....
First question - how close am i on the code? Am i on the right
track?
Second Question - If i save this as a function and call it in a query
how does it work to get the parameters that are on my form? Really i
need someone to fill the gaps of how to do this. i really suck at the
VB side of Access.
Any help would be awesome.
KO