A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Referencing an unbound text box on a report



 
 
Thread Tools Display Modes
  #1  
Old June 4th, 2004, 04:05 PM
Ben
external usenet poster
 
Posts: n/a
Default 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  
Old June 4th, 2004, 07:06 PM
Gerald Stanley
external usenet poster
 
Posts: n/a
Default 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  
Old June 4th, 2004, 07:26 PM
Steve Schapel
external usenet poster
 
Posts: n/a
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 12:07 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.