CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> ASP

 Newbie: Control a Label's Visability

Print topic Send  topic

Author Message
David
Posted: 02/11/2004, 1:43 PM

Hey there,

I am new to this and was curiouis as to how to control the visability of a label within an grid form if the label contains a certain value.

Example: I have a label field called "suffix" that a database stores the value "n/a" in if there is no suffix. When I connect to the database and draw a grid that contains the suffix, I want to contol it the if the "suffix" value = "n/a" do not make this label visable therefore "John Doe" will be displayed and not "John Doe N/A"

Anyhelp would be greatly appreciated.
peterr


Posts: 5971
Posted: 02/11/2004, 2:03 PM

Use the "Before Show Row" of the Grid to clear the Label value. For example:
GridName.Label1.Value = ""

Once the label is cleared then it will not be shown.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
David
Posted: 02/12/2004, 9:41 AM

Well that worked but now something wierd is happening. values for the suffix field are being carried over into new records.

Example. if it finally comes acroos a "Jr" , everyone after this record becomes "Jr" even though the database shows different. This is the custom code I am using. Like I said I am new at this.

'Custom Code @77-73254650
' -------------------------
if ProviderDirectory.MiddleName.value = "N/A" or ProviderDirectory.MiddleName.value = "n/a"
then
ProviderDirectory.MiddleName.visible = false
else
ProviderDirectory.MiddleName.visible = true
end if
' -------------------------
'End Custom Code



HELP!
David
Posted: 02/12/2004, 9:43 AM

Correction, This is the code!!!!

if ProviderDirectory.suffix.value = "N/A" or ProviderDirectory.suffix.value = "n/a" then
ProviderDirectory.suffix.visible = false
else
ProviderDirectory.suffix.visible = True
end if
DonB
Posted: 02/12/2004, 1:06 PM

Set the .Value = "" instead of the .Visible = False

You will not be changing the data in the database by doing this - only the
value displayed in the grid.

Do it in the Before Show Row event (NOT the BeforeShow).

--
DonB

http://www.gotodon.com/ccbth


"David" <David@forum.codecharge> wrote in message
news:6402bbb4e59c73@news.codecharge.com...
> Correction, This is the code!!!!
>
> if ProviderDirectory.suffix.value = "N/A" or
ProviderDirectory.suffix.value = "n/a" then
> ProviderDirectory.suffix.visible = false
> else
> ProviderDirectory.suffix.visible = True
> end if
>
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>


Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.