I tried this: If IsNull(Me!Pic) Then ...
I tried several variations of same.
Nothing worked. Any ideas?
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I did this -
Added an OLE field (MyOLE) to an existing test table.
Put a graphic in one record, but not others.
Created an AutoForm from the table.
Added a checkbox with its controlsource set to:
=isnull([MyOLE])
I could browse through the records; the checkbox correctly showed a
check where there was no entry in the table, and no check where there was a
table.
If this is not enough to get your application straightened out, perhaps
you could post the code that you are using in your OnCurrent event.
I'm also not quite sure of the significance of [DoItems] in your
presentation.
HTH
- Turtle
"mlh, eit" <Shak...@Triad.rr.com> wrote in message
news:nuv6ut8f4svmvrp00...@4ax.com...
Sub Form_Current ()
'*****************************************************************
' Added this code 12/24/2001 - long after this form's birth. Its
' purpose is to make a button visible if there is a graphic assoc-
' iated with the current Do-Item record.
'*****************************************************************
'Dim MyContents As Variant
'MyContents = Val(Forms!frmAdminDoListEntryForm!Pic) 'produces
'Invalid use of Null' error
'MyContents = Me![Pic]
'If IsNull(MyContents) Then 'produces
'Object has no value' error if MyContents = Me![Pic]
'If IsNull(Me!Pic) Then 'produces
'Object has no value' error
If IsNull([Pic]) Then 'produces
'Object has no value' error
'If Me!Pic Then 'produces
'Object has no value' error
PictureClicker.Visible = False
Pic.Visible = False
Else
PictureClicker.Visible = True
End If
End Sub
I have tried all the rem'd variations to no avail.
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
On Mon, 24 Dec 2001 10:20:04 -0500, "Turtle"
<macde...@mindspring.com> wrote:
HTH
- Turtle
"mlh, eit" <Shak...@Triad.rr.com> wrote in message
news:f0n8utcaadugidl6d...@4ax.com...
Sub Form_Current ()
'*****************************************************************
' Purpose is to make a button visible if there is a graphic
' associated with the current Do-Item record.
'*****************************************************************
On Error GoTo Form_Current_Err:
Dim ThisForm As String
ThisForm = Me.Name
PictureClicker.Visible = Not IsNull(Pic)
'(Above line is what Turtle recommended)
Dim WhichRec As Integer
WhichRec = GetFormRecNum(Me)
RecNum.Caption = "#" & Str$(WhichRec)
ExitForm_Current:
Exit Sub
Form_Current_Err:
Dim r As String, k As String, Message3 As String
r = "The following unexpected error occurred in Sub Form_Current,
CBF on " & ThisForm & "."
k = CRLF & CRLF & Str$(Err) & ": " & QUOTE & Error$ & QUOTE
Message3 = r & k
MsgBox Message3, 48, "Unexpected Error - " & MyApp$ & ", rev. " &
MY_VERSION$
Resume ExitForm_Current
End Sub
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
You recommended...
MyOLE.visible=not isnull(MyOLE)
I used....
PictureClicker.Visible = Not IsNull(Pic)
PictureClicker is a command button control (normally not visible).
Pic is the Ole-type control being polled for a reference pointer.
[MyTable].[Pic] cannot have a value because its an Ole type field.
I can, however, have an entry. I believe that entry can be a reference
pointer to a graphic bitmap code. The graphic can be stored as a
separate file on disk. Or it can be integrated into the mdb itself. In
my case, its the latter. Dunno if that makes a difference.
If my memory serves me, treatment of OLE objects did change considerably
between Access 2.0 and 97.
Not that it's relevant here, but both options (linked and embedded) store a
copy of the bitmap image inside the mdb.
I'm quite sure that this has been the case in all versions since Access 2.0.
Since 97, it has been quite easy to store the image in a separate file and
display it in an image control; this could be done in Access 2.0 using an
unbound object frame, but this was a little more cumbersome.
Even in Access 2.0, I'd recommend storing the image in a separate file, and
at a maximum storing the path and filename in the Access database. Since
the stored data then becomes a text field, it's pretty simple to use Dir()
to check for the presence of a file by the name stored. Empty strings
should pose a minimal problem.
HTH
- Turtle
"mlh, eit" <Shak...@Triad.rr.com> wrote in message
news:k39out07r4d45oi88...@4ax.com...