Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Bound Object Frame - Insert Dialog Box Appears Twice

Status
Not open for further replies.

joczar

Programmer
Jan 7, 2003
2
US
I have a data entry form that will be used to enter specifics about contracts. The underlying table for the form has a field called ApprovedContractLink that has an OLE Object data type. On the form, I have a Bound Object Frame that is bound to the ApprovedContractLink field. The data entry person can click on this control to browse to the network location where the approved contract file is stored, and link that document to the table.

Everything works, meaning the link is saved to the record. The problem I am having is that the browse to file dialog box pops up twice, once when they click on the control (because I have an On Click event coded for this), a second time when the control looses focus. Why is the dialogue box coming up again when the control looses the focus?

This is my first time ever using a bound object frame like this, and I am probably missing something elementary… Any help you can offer will be greatly appreciated.

Here is the code behind the bound object frame’s On_Click event:

Code:
Private Sub bofApprovedContractLink_Click()
'bring up a browse box to allow user to link the contract to the record

    bofApprovedContractLink.Action = acOLEInsertObjDlg
    Me.lblApprovedClickHere.Visible = False
        
End Sub

Pertinent (maybe) control properties are:

Control Source = ApprovedContractLink
Display Type = Icon
Update Options = Automatic
OLE Type Allowed = Linked
 
Still no soultion to this problem, but like the old adage says, "there is more than one way to skin a cat."

I figured I could try this with hyperlinks, and it's working great. With the help of a post by Godofhell, thread702-1062769, I was able to make a command button that saved the path to a text box on the form, and to the field on the table. Also used FollowHyperlink in the DblClick event of the text control so the user could view what they just linked.

Godofhell gets a star!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top