473,789 Members | 2,774 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to make control invisible when text value is zero?

I have a report with a text box named Discount. If this text box
shows a value of 0, I do not want the text box to be visible.

I have tried the following code, but it disables the control even when
the value is greater than zero. My IF statement seems to always be
true. Also, I can't find a value property for the text box.

I have searched and can't find the answer via Google.

Thanks.

Private Sub GroupFooter3_Fo rmat(Cancel As Integer, FormatCount As
Integer)
If Me.Discount = 0 Then
Discount.Visibl e = False
End If
End Sub

Jan 14 '07 #1
3 4652
Bill wrote:
>I have a report with a text box named Discount. If this text box
shows a value of 0, I do not want the text box to be visible.

I have tried the following code, but it disables the control even when
the value is greater than zero. My IF statement seems to always be
true. Also, I can't find a value property for the text box.

I have searched and can't find the answer via Google.

Thanks.

Private Sub GroupFooter3_Fo rmat(Cancel As Integer, FormatCount As
Integer)
If Me.Discount = 0 Then
Discount.Visibl e = False
End If
End Sub

There is not automatic thingie that sets Visible to True, so
you have to do it yourself:

If Me.Discount = 0 Then
Discount.Visibl e = False
Else
Discount.Visibl e = True
End If

Or, more concisely:

Discount.Visibl e = (Me.Discount <0)

--
Marsh
Jan 14 '07 #2
On Sun, 14 Jan 2007 16:50:17 -0600, Marshall Barton
<ma*********@wo wway.comwrote:
>Bill wrote:
>>I have a report with a text box named Discount. If this text box
shows a value of 0, I do not want the text box to be visible.

I have tried the following code, but it disables the control even when
the value is greater than zero. My IF statement seems to always be
true. Also, I can't find a value property for the text box.

I have searched and can't find the answer via Google.

Thanks.

Private Sub GroupFooter3_Fo rmat(Cancel As Integer, FormatCount As
Integer)
If Me.Discount = 0 Then
Discount.Visibl e = False
End If
End Sub


There is not automatic thingie that sets Visible to True, so
you have to do it yourself:

If Me.Discount = 0 Then
Discount.Visibl e = False
Else
Discount.Visibl e = True
End If

Or, more concisely:

Discount.Visibl e = (Me.Discount <0)
I thought it was "automatic" because they are visible by default and
show up if no code is written?

I guess you are saying that when I change it to False, I have to
change it back when I want it to be True?

Thanks.
Jan 15 '07 #3
"Bill" <Bi**@yahoo.com wrote
I thought it was "automatic" because they are
visible by default and show up if no code is written?
That's almost true... the Visible property is set True by default, UNLESS
you change that Property in Design View. Whatever the value set in Design
View, will apply when the Form is first Opened in Form View. Once you change
it from its Design View setting, it will retain the value you set, until you
change that value or Close the Form. To set it _permanently_ to a different
value, you'd have to make the change in Design View.
I guess you are saying that when I change it to False, I have to
change it back when I want it to be True?
Yes, see above.

Larry Linson
Microsoft Access MVP

Jan 15 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
6826
by: Susan Bricker | last post by:
Greetings. I have three forms that are open at the same time. They are related and cascading. The first form (frmEventAdd) is the anchor. Each event can have many Trials. The second form is frmTrialInfo. Each Trial can have three Classes. The third form is frmClassInfo. These forms are used for update and adding new records. The user displays an event for update (frmEventAdd). Then clicks on a button to display the Trials for that event...
5
4319
by: Charles | last post by:
Hello, I would like for my users to have a calendar control only when needed. IE button click for the control to appear and then once the date is selected. Populate a text box and the calendar control then is invisible. How do I make the calendar control pop up over other control in a asp.net c# environment? Charles
2
1657
by: ACaunter | last post by:
Hi all, I have the following code in the html part of my asp.net page to display an activeX control object which is like a picture viewer: ---------------------------- Response.Write("<object style='position: absolute; left=275px; top=73px; width=725px; height=595px;' width='656px' height='475px' classid='clsid:68CE4C35-090C-470B-B956-96B129554E64' standby='Please Wait...' codetype='application/x-oleobject' codebase='com/test.cab'>" &...
6
14700
by: Selden McCabe | last post by:
I have a form with a bunch of image buttons. When the user moves the mouse over a button, I want to do two things: 1. change the Imagebutton's picture, and 2. make another control visible. I'm using the Imagebutton.Attributes.Add("onMouseOver","this.src = 'somepicture.jpg') and that works fine. I've tried some java script to change the other control's visible property by changing is className, but that doesn't seem to work
4
2476
by: NH | last post by:
Hi, I just cannot get this to work. I want to make a cell editable in a datagrid only if the value of another cell is something specific. I am able to capture the value of the other cell via the ItemDataBound event of the datagrid e.g. If e.Item.Cells(8).Text = "2" Then 'Make the textbox defined in my edititemtemplate read only of invisible End If
16
11592
by: Miguel Dias Moura | last post by:
Hello, i have 5 panels in an ASP.net / VB page. The panel 1 is visible the other 4 are NOT visible. I also have 5 images: image 1, image 2, ..., image5. When i click one of the images, image N, the panel N becomes visible and all the other invisible.
6
5942
by: Ian Boyd | last post by:
Every time during development we had to make table changes, we use Control Center. Most of the time, Control Center fails. If you try to "undo all", it doesn't, and you end up losing your identity seed, or your constraints, or your triggers, or your table. Talking to developers at other companies who have had the misfortune of using DB2, they are adamant that you cannot use the tools; they are buggy and you just have to resign yourself to...
1
420
by: Bill | last post by:
I have a report with a text box named Discount. If this text box shows a value of 0, I do not want the text box to be visible. I have tried the following code, but it disables the control even when the value is greater than zero. My IF statement seems to always be true. Also, I can't find a value property for the text box. I have searched and can't find the answer via Google. Thanks.
5
2993
by: programmerboy | last post by:
I never had this kind of issue before and it is completely surprising. I have a usercontrol where I need 2 forms to make 1 form. When I have only 1 form it submits the page to itself. I have spent hours on this and couldn't find the solutions, thats why I have to come with a hack. I have two forms, I made the first form invisible and let the second form visible.This form is for google custom search engine. I also tried with other test forms, but...
0
9511
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10199
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9983
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9020
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7529
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6769
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5417
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4092
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2909
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.