Welcome to SPN

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

Sign Up Now!
  1.   Become a Supporter    ::   Make a Contribution   
    Target (Recurring Monthly): $200 :: Achieved: $98

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
    >
    >
    >
     
Since you're here... we have a small favor to ask...

More people are visiting & reading SPN than ever but far fewer are paying to sustain it. Advertising revenues across the online media have fallen fast. So you can see why we need to ask for your help. Donating to SPN's is vote for free speech, for diversity of opinions, for the right of the people to stand up to religious bigotry. Without any affiliation to any organization, this constant struggle takes a lot of hard work to sustain as we entirely depend on the contributions of our esteemed writers/readers. We do it because we believe our perspective matters – because it might well be your perspective, too... Fund our efforts and together we can keep the world informed about the real Sikh Sikhi Sikhism. If everyone who writes or reads our content, who likes it, helps us to pay for it, our future would be much more secure. Every Contribution Matters, Contribute Generously!

    Become a Supporter      ::     Make a Contribution     



Share This Page