Can AutomaticLink include a subset of DataRecordSet?

Started by lovehate, August 22, 2016, 11:36:40 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

lovehate

Hi again. 
1) I have a dataRecordSet that includes, say 10 fields.
2) I only want to include 2 of them when I link to a shape.
3) No matter what I try, I get mixed results. Some of the shapes take only what I want from the recordSet, while others take ALL the available fields, which causes a real mess.

Code snippet:


    Dim ColumnNames() As String
    Dim ShapeValues() As String
    Dim FieldTypes() As Long
    Dim returnIDsOfLinkedShapes() As Long
    Dim autoLinkBehaviors As Integer
    Dim recordSetName
    recordSetName = "VisRpt"
    rid = 5
    autoLinkBehaviors = visAutoLinkIncludeHiddenProps + visAutoLinkNoApplyDataGraphic + _
       visAutoLinkNullMatchesNoFormula + visAutoLinkReplaceExistingLinks
    FieldsString = "GUID,Description"
    ColumnNames = Split(FieldsString, ",")
    ShapeValues = Split(FieldsString, ",")
    FieldTypes(0) = visAutoLinkCustPropsLabel
    FieldTypes(1) = visAutoLinkCustPropsLabel

    ActiveWindow.Selection.AutomaticLink rid, ColumnNames, FieldTypes, ShapeValues, autoLinkBehaviors, returnIDsOfLinkedShapes


I know I can solve this problem by fetching dataRecordSets for each subset I want, but that is *very* inconvenient and has many associate risks.  Anybody have a good idea how to control AutomaticLink behavior?
Thanks.