Unbound object frame problems
Posted on 2000-03-20
I added an unbound object frame to one of my forms. I based it on an existing ms project 98 .mpp file.
i have a combobox cmbprograms. i want to update the unbound control source by what i choose from the combobox. in the on click event i called the next procedure:
Then I added the following procedure:
Private Sub UpdProjectSrc()
Dim rsProj As Recordset
On Error GoTo UpdProjectSrc_Err
Set rsProj = CurrentDb.OpenRecordset("Select WorkPlanFile from MppFiles where ProgramName='" & Me.cmbProject.Text & "'", _
OLEUnbound0.Class = "Microsoft Project 8.0" ' Set class name.
OLEUnbound0.OLETypeAllowed = acOLEEither ' Specify type of object.
OLEUnbound0.SourceDoc = rsProj!WorkPlanFile ' Specify source file.
OLEUnbound0.SetFocus 'tried both with this option and with out it!!!
OLEUnbound0.Action = acOLEActivate 'acOLEUpdate ' acOLECreateEmbed 'update embedded object.
OLEUnbound0.SizeMode = acOLESizeZoom ' Adjust control size.
If Not rsProj Is Nothing Then
Set rsProj = Nothing
MsgBox Err.Description & " " & Err.number & " " & Err.Source & Chr(13) _
& " Invalid Path"
the purpose was to update the unbound ctl with a program that is chosen in the cmbprograms combobox. when i use the acoleactivate in the .action i get the same source file (not the one i specified in the sourcedoc.) when i use acolecreateembed i get the following error:
*make sure the file is installed on your computer and that you used the correct filename.
*check the ole server documentation for info about syntax...
If i use the acoleupdate i get the next error:
the ole object isn't registered. the object may be calling an application that isn't registered. to register the application reinstall it.
can someone tell me how to update the source doc of the unbound control and immidiatly see the diffrent ms project file. on the form.
thank you very much.