How to minus "The OLE object is empty" message ?

B

bruce

I have a subform the contains an OLE field which may or may not contain

data depending on the record. When you have focus on the bound object
frame
for the OLE and it is empty then move to a different subform or main
form,
it acts as though you have double clicked and want to edit the object.
You
then receive the following message:

The OLE object is empty.
You can't edit a bound object frame if the field in the underlying
table
doesn't contain an OLE object.
Embed or link an OLE object into the bound object frame using......

I have checked the events for both the subform and the frame. there is
nothing that should cause this to happen.

Any thoughts would help!!!

P.S.
If you move to an object within the same subform you do not get the
error
message.

This is a old question asked by someone else, but encountered by me
now!

Any suggestion will be appreciated!
Thanks alot!
 
J

James

Hi

This may not be the best solution but in the properties of the OLE
field you could set "Tab Stop" to No so that it will only receive the
focus when it is clicked or any VBA code gives it the focus.

Regards
James
 
B

bruce

I Tried it, but the problem cannot be resolved, the message still pop
up.
Thanks for suggestion!
 
S

Stephen Lebans

In the form's Current event, check to see if the control is empty, if so
then Disable the control, if not then Enable the control.
*Air Code*

If NOT (IsNull(Me.NameOfYourOLEFrameControl.Value)) Then
' Yes there is OLE Data
Me.NameOfYourOLEFrameControl.Enabled = True
Else
' No there is no OLE data
Me.NameOfYourOLEFrameControl.Enabled = False
End If

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top