Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

Setting SourceDoc in VB

Discussion in 'Information Technology' started by Joel, Nov 3, 2005.

  1. Joel

    Joel
    Expand Collapse
    Guest

    Hello,
    I have a unbound OLE object in my form and I would like to change the
    SourceDoc path with VB but it will not change.

    EX:
    Private Sub Form_Current()
    Me.AutocadDWG.SourceDoc = Me.tbAutoCadloc
    me.refresh
    End Sub

    This works great with an image frame but I cant get it to work with an
    Unbound Object.

    Thanks
    Joel
     
  2. Loading...

    Similar Threads Forum Date
    General Great Production of English Songs and scene settings Videos Oct 11, 2012
    Hinduism Why is there Dancing in Bhajans or in Mandir Settings? Interfaith Dialogues Feb 18, 2011
    Personal Goal Setting. Why Set Goals? Business, Lifestyle & Leisure Oct 23, 2010
    Rise in Extremism or Rise in Hysteria? Canadian Sikhs Setting the Record Straight Hard Talk Apr 25, 2010
    Sikh News Badal invited to Pakistan for setting up of Nanak varsity (New Kerala) Breaking News Nov 23, 2009

  3. David Lloyd

    David Lloyd
    Expand Collapse
    Guest

    Joel:

    In order for the SourceDoc property change to be reflected in the form you
    need to set the Action property of the unbound OLE object. The Enabled
    property must be set to Yes and the Locked property must be set to No for
    this to work properly. For example:

    Private Sub Form_Current()
    'Linked OLE object
    Me.OLEUnbound15.SourceDoc = "H:\TestTarget.xls"
    Me.OLEUnbound15.Action = acOLECreateLink

    'Embedded OLE object
    Me.OLEUnbound16.SourceDoc = "H:\TestTarget.xls"
    Me.OLEUnbound16.Action = acOLECreateEmbed
    End Sub

    --
    David Lloyd
    MCSD .NET
    http://LemingtonConsulting.com

    This response is supplied "as is" without any representations or warranties.


    "Joel" <Joel@discussions.microsoft.com> wrote in message
    news:4A4641ED-5FE9-48F9-8EA1-931821AC641E@microsoft.com...
    Hello,
    I have a unbound OLE object in my form and I would like to change the
    SourceDoc path with VB but it will not change.

    EX:
    Private Sub Form_Current()
    Me.AutocadDWG.SourceDoc = Me.tbAutoCadloc
    me.refresh
    End Sub

    This works great with an image frame but I cant get it to work with an
    Unbound Object.

    Thanks
    Joel
     
  4. Joel

    Joel
    Expand Collapse
    Guest

    Thanks David, it worked great.

    "David Lloyd" wrote:

    > Joel:
    >
    > In order for the SourceDoc property change to be reflected in the form you
    > need to set the Action property of the unbound OLE object. The Enabled
    > property must be set to Yes and the Locked property must be set to No for
    > this to work properly. For example:
    >
    > Private Sub Form_Current()
    > 'Linked OLE object
    > Me.OLEUnbound15.SourceDoc = "H:\TestTarget.xls"
    > Me.OLEUnbound15.Action = acOLECreateLink
    >
    > 'Embedded OLE object
    > Me.OLEUnbound16.SourceDoc = "H:\TestTarget.xls"
    > Me.OLEUnbound16.Action = acOLECreateEmbed
    > End Sub
    >
    > --
    > David Lloyd
    > MCSD .NET
    > http://LemingtonConsulting.com
    >
    > This response is supplied "as is" without any representations or warranties.
    >
    >
    > "Joel" <Joel@discussions.microsoft.com> wrote in message
    > news:4A4641ED-5FE9-48F9-8EA1-931821AC641E@microsoft.com...
    > Hello,
    > I have a unbound OLE object in my form and I would like to change the
    > SourceDoc path with VB but it will not change.
    >
    > EX:
    > Private Sub Form_Current()
    > Me.AutocadDWG.SourceDoc = Me.tbAutoCadloc
    > me.refresh
    > End Sub
    >
    > This works great with an image frame but I cant get it to work with an
    > Unbound Object.
    >
    > Thanks
    > Joel
    >
    >
    >
     

Share This Page