R
Roland Alden
I have the following line of code in a Form_Current:
If Form.[dog] <> Null Then
Let [name-call].Text = ""
End If
[dog] is a control bound to a Guid in the underlying table. If the Guid is
in fact Null the code works and the Let [name-call].Text = "" branch will
execute. However, if [dog] holds some legit value I get an error 13 "type
mismatch".
I notice that If Form.[dog] Is Null will always fail with an "Object
Required" error. This leads me to believe that somehow the test for nullness
is being performed by the underlying "object" which, if null, is not there.
Tricks like using If Form.[dog].Value <> Null don't work either (it still
produces a type mismatch in the non null case).
Efforts to use StringFromGUID fail as well.
What am I missing? My objective is to set some other control [name-call] to
blank if this field is non-Null.
Another objective is to have that happen on the form only; I don't want the
blank values to be written to the underlying database. I made [name-call] be
a "Locked" field for "display only" but apparently this does not apply to VB
code since if I programatically Let [name-call].Text = "foo" then the record
will be marked dirty and get written. I just want the screen to be
uncluttered in this case so want my changes to not affect the underlying
data.
If Form.[dog] <> Null Then
Let [name-call].Text = ""
End If
[dog] is a control bound to a Guid in the underlying table. If the Guid is
in fact Null the code works and the Let [name-call].Text = "" branch will
execute. However, if [dog] holds some legit value I get an error 13 "type
mismatch".
I notice that If Form.[dog] Is Null will always fail with an "Object
Required" error. This leads me to believe that somehow the test for nullness
is being performed by the underlying "object" which, if null, is not there.
Tricks like using If Form.[dog].Value <> Null don't work either (it still
produces a type mismatch in the non null case).
Efforts to use StringFromGUID fail as well.
What am I missing? My objective is to set some other control [name-call] to
blank if this field is non-Null.
Another objective is to have that happen on the form only; I don't want the
blank values to be written to the underlying database. I made [name-call] be
a "Locked" field for "display only" but apparently this does not apply to VB
code since if I programatically Let [name-call].Text = "foo" then the record
will be marked dirty and get written. I just want the screen to be
uncluttered in this case so want my changes to not affect the underlying
data.