Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / General 2 / January 2008

Tip: Looking for answers? Try searching our database.

Nz function sounds good but really I want more than a number or a string.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
George Hester - 19 Jan 2008 06:03 GMT
According to this page:

http://support.microsoft.com/kb/295619/en-us

Microsoft says the IsNull(fax.value) will evaluate to False when fax.value =
Null. Well it's a good thing I didn't bother to read that article until afer
I started using IsNull.

I have some fields in a database that are sparsely populated. I wanted to
make sure the Child_Labels in the Text box that is to display those fields
stayed invisible when there was nothing for the field value. So I used
IsNull and have been chugging merrily away using it. Until I read this
article. Now I am not sure why what they say doesn't work. Is this true for
Nz in a DAP? Is it always true? I don't get it. Maybe someone does?

I am accepting to try the Nz workaround since what I been using "doesn't
work." But consider the restrictions of this function. We can only replace a
variable that is Null with a value which isn't. Of course I want my Null
values to stay Null. I just want to hide the controls that are not showing
the field with the Null value. So how can I use Nz to do this? Something
like:

Nz(MSDOC.DefaultRecordSet.Fields("Field1").Value,document.all.item("Text0").
style.visibility = "hidden")
Nz(MSDOC.DefaultRecordSet.Fields("Field1").Value,document.all.item("Text0_Ch
ildLabel").style.visibility = "hidden")

I doubt that will work better than:

If IsNull(MSDOC.DefaultRecordSet("Field1").Value) Then
  document.all.item("Text0").style.visibility = "hidden"
  document.all.item("Text0_ChildLabel").style.visibility = "hidden"
Else
  document.all.item("Text0").style.visibility = "visible"
  document.all.item("Text0_ChildLabel").style.visibility = "visible"
End If

And yes this does work. But I would like to try the workarounds using Nz as
Microsoft says to achieve the above.

--

George Hester
_________________________________
John W. Vinson - 19 Jan 2008 07:31 GMT
>According to this page:
>
>http://support.microsoft.com/kb/295619/en-us
>
>Microsoft says the IsNull(fax.value) will evaluate to False when fax.value =
>Null.

... using Access 2002. Not other versions.

>Well it's a good thing I didn't bother to read that article until afer
>I started using IsNull.
[quoted text clipped - 5 lines]
>article. Now I am not sure why what they say doesn't work. Is this true for
>Nz in a DAP? Is it always true? I don't get it. Maybe someone does?

This was a bug in one version. It's been fixed.

>I am accepting to try the Nz workaround since what I been using "doesn't
>work."

This was a bug in one version. It's been fixed.

>And yes this does work. But I would like to try the workarounds using Nz as
>Microsoft says to achieve the above.

Reread the article, in particular the "Applies To".

            John W. Vinson [MVP]
Terry Kreft - 19 Jan 2008 13:16 GMT
You've got the choice of using an obscure non-supported bug or using
supported clear code and you want to use the bug?

Go with the code, it's easier to read and in a years time when you have to
revisit it you won't be wondering how these controls are getting hidden.

If you have to upgrade from the bugged version you wont have to revisit the
form to do this properly.

Just use code.

Signature

--
Terry Kreft

> According to this page:
>
[quoted text clipped - 45 lines]
> George Hester
> _________________________________
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.