G
George Hester
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.
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.