Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access thread: Conditional Value In A TextBox In A Report!


Message #1 by "Jonathan R. Els" <jonathan.els@f...> on Fri, 26 Apr 2002 02:38:22 +0200
This is a multi-part message in MIME format.

------=_NextPart_000_000B_01C1ECCB.73EF66B0
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit

Dear Group,
 
We have a report that has a text box who's value needs to be based on a
conditional expression, how do we code for a conditional expression??
And then move the result into the text box.
 
Eg.
 
If Balance >= Payment Then
    TextBox = Payment
Else
    TextBox = 0
End If
 
Based on the senario, we want to move into this text box, either the
payment or a zero.
 
Any help will be greatly appreciated!!
 
Kind Regards,
Jonathan & Cathy



Message #2 by "John Ruff" <papparuff@c...> on Thu, 25 Apr 2002 18:28:42 -0700
This is a multi-part message in MIME format.

------=_NextPart_000_0005_01C1EC87.0B0176F0
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit

Place your code in the report's Detail Section's On Format event
 
 

John Ruff - The Eternal Optimist :-) 
Always looking for Contract Opportunities 
  
9306 Farwest Dr SW 
Lakewood, WA 98498 
papparuff@c... 

-----Original Message-----
From: Jonathan R. Els [mailto:jonathan.els@f...] 
Sent: Thursday, April 25, 2002 5:38 PM
To: Access
Subject: [access] Conditional Value In A TextBox In A Report!
Importance: High


Dear Group,
 
We have a report that has a text box who's value needs to be based on a
conditional expression, how do we code for a conditional expression??
And then move the result into the text box.
 
Eg.
 
If Balance >= Payment Then
    TextBox = Payment
Else
    TextBox = 0
End If
 
Based on the senario, we want to move into this text box, either the
payment or a zero.
 
Any help will be greatly appreciated!!
 
Kind Regards,
Jonathan & Cathy
--- 



Message #3 by "Cathy L. Price" <cprice7777@e...> on Thu, 25 Apr 2002 23:05:08 -0400
This is a multi-part message in MIME format.

------=_NextPart_000_0006_01C1ECAD.A5D60AD0
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit

Thank you John! 
 
I am Cathy, Jonathan's partner. We are VB developers and often use SQL
for database development. But we are working with a customer's Access
database now and he has a report that was set up in Access by a previous
programmer. Jonathan and I are just now learning some of the power of
Access, due to your earlier responses, and those of other group members,
to our database merge problem (which turned out very well, much thanks
to all who helped us out!!!). We have never used VBA (which I guess is
what you are referring to below). But we have never written a report in
Access, let alone to modify a fairly complex existing one. Our field is
in a footer... can we still do code for a textbox in this area of the
report??? And if so, how do we generate this code?  Do we set up Sub
Procedures just as we would in VB? And can we reference in our code the
other textbox names that are on our report, since we need to use them in
the conditional statement? Sorry to ask such fundamental questions, but
the examples online were not clear enough for us to understand and apply
to our situation.
 
Thanks for any help you can give!! It is sincerely appreciated!
 
Kind Regards,
Cathy & Jonathan
 
 
 

-----Original Message-----
From: John Ruff [mailto:papparuff@c...] 
Sent: Thursday, April 25, 2002 9:29 PM
To: Access
Subject: [access] RE: Conditional Value In A TextBox In A Report!


Place your code in the report's Detail Section's On Format event
 
 

John Ruff - The Eternal Optimist :-) 
Always looking for Contract Opportunities 
  
9306 Farwest Dr SW 
Lakewood, WA 98498 
papparuff@c... 

-----Original Message-----
From: Jonathan R. Els [mailto:jonathan.els@f...] 
Sent: Thursday, April 25, 2002 5:38 PM
To: Access
Subject: [access] Conditional Value In A TextBox In A Report!
Importance: High


Dear Group,
 
We have a report that has a text box who's value needs to be based on a
conditional expression, how do we code for a conditional expression??
And then move the result into the text box.
 
Eg.
 
If Balance >= Payment Then
    TextBox = Payment
Else
    TextBox = 0
End If
 
Based on the senario, we want to move into this text box, either the
payment or a zero.
 
Any help will be greatly appreciated!!
 
Kind Regards,
Jonathan & Cathy
--- 

--- 




Message #4 by "John Ruff" <papparuff@c...> on Thu, 25 Apr 2002 23:09:10 -0700
This is a multi-part message in MIME format.

------=_NextPart_000_0015_01C1ECAE.371FF370
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit

Cathy,
 
It's the same as if you were writing code for a form.  Without knowing
the structure of your report I'm going to say that you should place the
code in the report footer's On format event.  It would look like this:
 

Private Sub ReportFooter_Format(Cancel As Integer, FormatCount As
Integer)
    
    If Balance >= Payment Then
        TextBox = Payment
    Else
        TextBox = 0
    End If
 
End Sub

Open the report in design view.  Right-click on the Report Footer bar
and select properties.  When the "Section:ReportFooter" dialog box
appears, select the Event tab.  Press the button to the right of the On
Format event (the one with the 3 elipses) and choose Procedure.  The
Visual Basic Editor (VBE) will open and you will be in the Private Sub
ReportFooter_Format(Cancel As Integer, FormatCount As Integer)
procedure.  This is where you will place the code.
 
 

John Ruff - The Eternal Optimist :-) 
Always looking for Contract Opportunities 
  
9306 Farwest Dr SW 
Lakewood, WA 98498 
papparuff@c... 

-----Original Message-----
From: Cathy L. Price [mailto:cprice7777@e...] 
Sent: Thursday, April 25, 2002 8:05 PM
To: Access
Subject: [access] RE: Conditional Value In A TextBox In A Report!


Thank you John! 
 
I am Cathy, Jonathan's partner. We are VB developers and often use SQL
for database development. But we are working with a customer's Access
database now and he has a report that was set up in Access by a previous
programmer. Jonathan and I are just now learning some of the power of
Access, due to your earlier responses, and those of other group members,
to our database merge problem (which turned out very well, much thanks
to all who helped us out!!!). We have never used VBA (which I guess is
what you are referring to below). But we have never written a report in
Access, let alone to modify a fairly complex existing one. Our field is
in a footer... can we still do code for a textbox in this area of the
report??? And if so, how do we generate this code?  Do we set up Sub
Procedures just as we would in VB? And can we reference in our code the
other textbox names that are on our report, since we need to use them in
the conditional statement? Sorry to ask such fundamental questions, but
the examples online were not clear enough for us to understand and apply
to our situation.
 
Thanks for any help you can give!! It is sincerely appreciated!
 
Kind Regards,
Cathy & Jonathan
 
 
 

-----Original Message-----
From: John Ruff [mailto:papparuff@c...] 
Sent: Thursday, April 25, 2002 9:29 PM
To: Access
Subject: [access] RE: Conditional Value In A TextBox In A Report!


Place your code in the report's Detail Section's On Format event
 
 

John Ruff - The Eternal Optimist :-) 
Always looking for Contract Opportunities 
  
9306 Farwest Dr SW 
Lakewood, WA 98498 
papparuff@c... 

-----Original Message-----
From: Jonathan R. Els [mailto:jonathan.els@f...] 
Sent: Thursday, April 25, 2002 5:38 PM
To: Access
Subject: [access] Conditional Value In A TextBox In A Report!
Importance: High


Dear Group,
 
We have a report that has a text box who's value needs to be based on a
conditional expression, how do we code for a conditional expression??
And then move the result into the text box.
 
Eg.
 
If Balance >= Payment Then
    TextBox = Payment
Else
    TextBox = 0
End If
 
Based on the senario, we want to move into this text box, either the
payment or a zero.
 
Any help will be greatly appreciated!!
 
Kind Regards,
Jonathan & Cathy
--- 

--- 

--- 




  Return to Index