0
votes

I have a scenario here with my MS Access Report where the ControlSource of a specific text box can vary depending on the value of a field bound to that report.

For example:

If VALUE = 1 then Me.txtFeesAndExpenses.ControlSource = "The following fees for this specific scenario are " & FEE_VALUE End if

OR

If VALUE = 2 then Me.txtFeesAndExpenses.ControlSource = "The following fees for this OTHER specific scenario are " & FEE_VALUE End if

I'm having trouble with where I should place this code on my report so that the proper value is bound to the textbox.

1

1 Answers

1
votes

Isn'it easier to use calculated field and set such ControlSource in the design mode:

 ="The following fees for " & SWITCH(VALUE=1,"THIS",value=2,"OTHER",true," ERROR ")
    & " specific scenario are " & FEE_VALUE