doulostheou
Registered User.
- Local time
- Today, 04:56
- Joined
- Feb 8, 2002
- Messages
- 314
I thought this was going to be as easy as doing it on a form, but apparently I was wrong. I have a month end report. When you click the button to open it the "MonthSelect" form opens and asks you to select the appropriate month. When you click okay, the form opens. My problem is that it is partially based off a crosstab query. In this query there are values for each month, Scores.Jan, Scores.Feb, etc. I wanted to note which month was selected and change the controlsource of the field appropriately. I've done this in forms before, so I tried using the code:
If Forms!MonthSelect!Month="January" Then
Score.ControlSource = "Score.Jan"
Else If etc...
Apparently, the module was not recognizing Score (the name of my field in the report) and consequently would not let me asign a controlsource to it.
I then tried to manipulate at the query level. For one of my rows I typed
Score: "Score" & Left([Forms]![MonthSelect]![Month],3)
Unfortunately, this just returned the string "Score.Jan" and did not look up the appropriate value. Without creating six new queries (I simplified the names, there is actually a SOScore, SOOutof, SOCount, CRScore, CROutof, & CRCount), I am not sure where to go from here. Any suggestion would be appreciated.
If Forms!MonthSelect!Month="January" Then
Score.ControlSource = "Score.Jan"
Else If etc...
Apparently, the module was not recognizing Score (the name of my field in the report) and consequently would not let me asign a controlsource to it.
I then tried to manipulate at the query level. For one of my rows I typed
Score: "Score" & Left([Forms]![MonthSelect]![Month],3)
Unfortunately, this just returned the string "Score.Jan" and did not look up the appropriate value. Without creating six new queries (I simplified the names, there is actually a SOScore, SOOutof, SOCount, CRScore, CROutof, & CRCount), I am not sure where to go from here. Any suggestion would be appreciated.