J
JohnB
Hi.
Some days ago 'Brian' gave me a good solution to having the back style of an
Image control conditional on content/no content of field
txtImagePathAndFile. Brians solution is the following:
Private Form_Current()
If Not IsNull(txtImagePathAndFile) then
imgTheImage.BackStyle = 1
Else
imgTheImage.BackStyle = 0
End Sub
As I said in the original thread, this works perfectly but there is now a
small tweak that's needed. When a new blank record is selected for data
entry, text field txtImagePathAndFile is somehow treated as having content.
It's controlsource is a DLookUp and shows as #Error in a blank record. Could
the text field be made truly IsNull in a new blank record or could a change
be made to Brians code to ensure that this condition is treated as the field
being IsNull.
By the way, I tried turning the code on its head as follows, but that didn't
work either. It seems that when the text field is showing #Error it neither
has nor has not content.
Private Form_Current()
If IsNull(txtImagePathAndFile) then
imgTheImage.BackStyle = 0
Else
imgTheImage.BackStyle = 1
End Sub
Not the most major of problems, of course, but it would round things off
nicely if I could solve this. Thanks for any help. JohnB
Some days ago 'Brian' gave me a good solution to having the back style of an
Image control conditional on content/no content of field
txtImagePathAndFile. Brians solution is the following:
Private Form_Current()
If Not IsNull(txtImagePathAndFile) then
imgTheImage.BackStyle = 1
Else
imgTheImage.BackStyle = 0
End Sub
As I said in the original thread, this works perfectly but there is now a
small tweak that's needed. When a new blank record is selected for data
entry, text field txtImagePathAndFile is somehow treated as having content.
It's controlsource is a DLookUp and shows as #Error in a blank record. Could
the text field be made truly IsNull in a new blank record or could a change
be made to Brians code to ensure that this condition is treated as the field
being IsNull.
By the way, I tried turning the code on its head as follows, but that didn't
work either. It seems that when the text field is showing #Error it neither
has nor has not content.
Private Form_Current()
If IsNull(txtImagePathAndFile) then
imgTheImage.BackStyle = 0
Else
imgTheImage.BackStyle = 1
End Sub
Not the most major of problems, of course, but it would round things off
nicely if I could solve this. Thanks for any help. JohnB