Visio Proximity Movement

Started by Abeiis, April 25, 2017, 07:04:56 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Yacine

Hello Wayne,
I'm "almost" with you about the next steps, but not completely.
When Abe speaks about an ID, he must be meaning a sort field - no real shape ID, nor shape name or so.
The initial value of the sort field is used for the initial drawing, but it does not update when the list items are re-ordered. There's only a code link from the sort field to the actual order.
My suggestion - a user formula: setf(getref(prop.sort), listorder()) + dependson(listorder()). This way no event handling is required. No macro at all. That is, Abe will certainly ask to get the new order back to his database. That's where some tedious database coding is necessary: define a dao/ado recordset and link it to external source, loop through the datarecordset and write everything to the external source.
@Abe, having read your posts, I wonder if you have the skills to implement such a solution. Sorry for being so rude, but you seem to expect the forum to work out the final solution for you. Would it make sense to hire a programmer?
Yacine

Abeiis

Thanks - I will pursue your directions and update our discussion.
I always say; divide and conquer; in doing so, one learns and share its findings.
Here is what I do via code:
1. I created a Visio Template with VBA to connect a DB table to Visio
2. I already have a sorting field from the linked Db [OrderOfPriority], see diagram (Page-2).
3. I take each section (i.e. i, ii, iii, iv... etc.) and place a shape with a preset x/y/ coordinate on the active page. (and that is what I asked Yacine if it could be done in a List Control.)
4. Then I link the data in the same order to the shapes.
The output diagram is what I work on with the leadership team to move shapes and finalize the process, and that is what I was asking here to automate.
Wapperdude is correct in stating I need to update the DB with the new order after my Leadership meeting; and yes, I could do this with an ODBC connection but Microsoft changed their approach with ODBC and how it's functions between Visio and Access.

Q: What did you think of Scott's tutorial video? at 2.35 min. he show the added list controls take the numeric ID, and I am wondering how it is done - https://www.youtube.com/watch?v=UNhxdSRGAmc
I did leave a Q for him to answer, it does not seam too cumbersome; but if I could place the shapes in a List for each of column using the [OrderOfPriority] field value, and having the order value change as I manfully move it from position to another in the same List, then I'm done.

Regards, Abe

Yacine

#32
Quote from: Abeiis on May 03, 2017, 06:20:36 PM
3. I take each section (i.e. i, ii, iii, iv... etc.) and place a shape with a preset x/y/ coordinate on the active page. (and that is what I asked Yacine if it could be done in a List Control.)
Sure, that is the function DropIntoList that I mentioned before. To be used with the reorder function to get the right sorting.

QuoteQ: What did you think of Scott's tutorial video? at 2.35 min. he show the added list controls take the numeric ID, and I am wondering how it is done - https://www.youtube.com/watch?v=UNhxdSRGAmc
I did leave a Q for him to answer, it does not seam too cumbersome; but if I could place the shapes in a List for each of column using the [OrderOfPriority] field value, and having the order value change as I manfully move it from position to another in the same List, then I'm done.
That's what the file uploaded by myself shows. Download my attachment and play with it to understand the list behaviour. Have a look at the shapesheet.
Yacine

Abeiis

Thanks Yacine - I did use your code in the document to rearrange the shapes and I also added a line of code to align Left in-case I dropped the shape off-alignment - but all that is omitted if we use the List Box you have suggested before, and I agree the List Box does what I need except I am not yet able to change the ID (or any other field that one can preset) as with the video by Scott indicated (see link in my previous post).

Abeiis

Hi ALL,
I found how Scott got the number in the List Control, and it is simple.
1. Select the List Control
2. In the Tools Ribbon - Insert Tab - select [Field]
3. Select Custom Formula
4. Then type "=LISTORDER()"

This is what I was looking for - I just need to find a way to point my linked field [OrderOfPriority] to the custom formula.

Regards,
Abe

Yacine

??? Have a look at the attachment in Reply #23 (the vsdx)
Yacine

Abeiis

#36
I did, and I did not see any code - I was hoping to see working example to place a control from the document stencil on to a List Control with a loop to add 3 controls in each of the List Boxes that will be greatly appreciated - you can use the attached template, Thanks!

PS: How do I rename a listbox - when I place the 1st ListBox it takes its name from master (stencil), and as I add more Listboxes, it skips 4 number and added it to the name. Looking forward; as we add ListItems, I want to be able to cycle through the Listboxs via variable "i" and therefore I need to rename these Lists incrementally. 

Regards,
Abe

Abeiis

#37
Dear ALL,
It's a good feeling to conquer multiple obstacles ;-)

I reached the solution to my original question (see attachment), and I hope this will help others in this forum.
     Notice - See code in the Document VBA Editor - 3 ListBoxes need to be placed already in the diagram.
   
My next task is, to find a way to link data from an Excel or Access to each of the List-Controls... food for thoughts.

Regards,
Abe