Referencing an unbound text box on a report

  • Thread starter Thread starter Ben
  • Start date Start date
B

Ben

I am using the following code to calculate the value of a
unbound text box named "Letter Received":

If [Number Of Letters Received] = 0 Then
Me.Letter_Received ...
ElseIf [Number Of Letters Received] = 1 Then
Me.Letter_Received = ...
ElseIf [Number Of Letters Received] = 2 Then
Me.Letter_Received = ...
ElseIf [Number Of Letters Received] = 3 Then
Me.Letter_Received = ...
ElseIf [Number Of Letters Received] = 4 Then
Me.Letter_Received = ...
Else: Me.Letter_Received = "None"

On my report I want to show the value of this calculated
text box. I could store the value in the table but that
seems pointless and a waist of space. When should I
calculate this value (before open?) and how do I
reference this value from my report
 
If [Number Of Letters Received] is another control, then I
suggest setting the controlSource of [Letter_Received] to
=Switch([Number Of Letters Received]=0,"what you want",
[Number Of Letters Received]=1, "what you want", [Number Of
Letters Received]=2,"what you want", [Number Of Letters
Received]=3, "what you want",[Number Of Letters
Received]=4, "what you want")

and setting the DefaultValue to "None"

Hope This Helps
Gerald Stanley MCSD
 
Ben,

If I understand you correctly, I think this code will work if you put it
on the On Format event of the report section that contains the
Letter_Received control.
 
Back
Top