473,386 Members | 1,969 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Unable to Hide control when the value is null

Pls help; I suppose following would be the right code to hide an empty control (TestMethod) but its not working; I checked by making a query- When I put a criteria IsNull the field is removed from the query results which means that the empty fields are actually "Null"; I tried using some existing values of the field test method- it works e.g when I substituted Null with "Slide Method" all entries containing "slide method" are removed/Hidden.

Expand|Select|Wrap|Line Numbers
  1. Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
  2. If Me.TestMethod = Null Then
  3. Me.TestMethod.Visible = False
  4. End If
  5.  
  6. End Sub
Nov 26 '10 #1
1 1340
NeoPa
32,556 Expert Mod 16PB
You're on the right track, but Null isn't a value as such so cannot be compared against. You should use the function IsNull() instead. This returns TRUE if the parameter passed is Null. Your code could read :
Expand|Select|Wrap|Line Numbers
  1. Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
  2.     Me.TestMethod.Visible = (Not IsNull(Me.TestMethod))
  3. End Sub
This also handles the other point which you missed, which is to reset the control as visible for all other occasions ;-)
Nov 26 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: aquimr | last post by:
Hi, I'm using input hidden control's value in the javascript function. same code is working fine on all other browser except a specific version of safari(i.e.: MAC OS 10.3.7 and Safari 1.2.4)....
3
by: Fabio Negri Cicotti [MCP] | last post by:
Hi All. I'm trying to insert data into 2 tables (parent-child) using the ADO.NET's SetParentRow method. The parent table has an identity column as primary key. When I execute the code below I...
1
by: Blake Versiga | last post by:
When editing a datagrid (C#) I need to know if the user changed the value of cell AND what the previous value was. Is this possible? If so how do I get the previous value or at least if the...
2
by: Chris Barrow | last post by:
Hi everyone, Does anyone know if there is a problem populating a system.web.ui.htmlcontrols.htmlinputtext control when the control's type is set to "password?" I am attempting to retreive a...
5
by: dbuchanan | last post by:
Is it possible to detect the SQLS2K column level permission for the logged in user. I want to be able to hide a control or Button based on user permission to edit that column. Can anyone...
0
by: rganvir | last post by:
I am having a user control in which there i one text box and a button, when clicked on a popup window is opend which is having a calendar control when the user selects date from the calendar control...
0
by: anibakore | last post by:
Hi All, I am using product.xml for vs2005 pre-requisites. I am using <RegistryCheckinside <InstallCheck>. I am trying to read one registry value of installed software. I can see it through...
1
by: --== Alain ==-- | last post by:
Hi, I finally found how to update the render of my custom control when one of its property value changed. However, i would like to know if there is not another way, because i'm afraid about...
0
by: diane | last post by:
Just trying to upsize using VFP 9 with SQL 2005 using VFP remote views. One in particular keeps coming up and saying Cannot insert the value NULL into column, when I really don't think I am...
1
by: Octo Siburian | last post by:
I have been collecting data from ms.access database into a class object '_Get and put in data from database Fingerprint(RAS) into CPresensiFingerprint Public Function GetdbFingerprint() As...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
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...

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.