If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Referencing an unbound text box on a report
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 |
#2
|
|||
|
|||
Referencing an unbound text box on a 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 -----Original Message----- 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 . |
#3
|
|||
|
|||
Referencing an unbound text box on a report
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. -- Steve Schapel, Microsoft Access MVP Ben wrote: 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 |
Thread Tools | |
Display Modes | |
|
|