PC Review


Reply
Thread Tools Rate Thread

Closing an OleObject

 
 
=?Utf-8?B?dGtvc2Vs?=
Guest
Posts: n/a
 
      5th Apr 2006
I have a db with embedded ole objects. I want the user to be able to click
on a description name and that ole object will be launched. I want the
object to only be launched by one user and then not be able to be launched
again. I can control all this except for one thing. If a user launches the
object, then exits from my application, the ole object remains open and
another user could launch the same object.

Code for the Ole Object named Description appears below. This works fine.

Private Sub Description_DblClick(Cancel As Integer)
Me.Lock = True
With Forms.Item("1 - Main Menu").Controls.Item("OLEobject")
.Action = acOLEActivate
.Verb = acOLEVerbOpen
End With
Me.Lock.SetFocus
End Sub

Code which I think should close it appears below.

Private Sub Lock_LostFocus()
Me.Lock = False
With Forms.Item("1 - Main Menu").Controls.Item("OLEobject")
.Action = acOLEClose
End With
End Sub

This gives me a run time error '2793' - Cant perform the op specified in
the action property. I have already verified the enabled and locked
properties properly.

Any ideas on how I can close the ole object?

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Opening OLEOBJECT Barb Reinhardt Microsoft Excel Programming 1 17th Sep 2008 12:41 PM
OLEObject SG Microsoft Access Reports 0 5th Dec 2006 04:51 PM
OLEObject SG Microsoft Access Forms 0 5th Dec 2006 04:51 PM
OLEObject SG Microsoft Access Form Coding 0 5th Dec 2006 04:51 PM
OLEObject on worksheet. Trying to get value from it. Grant Microsoft Excel Programming 4 9th Aug 2004 06:00 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:46 AM.