Author Topic: Dynamic drawing based on Access data  (Read 111 times)

0 Members and 1 Guest are viewing this topic.

AggKat

  • Newbie
  • *
  • Posts: 3
Dynamic drawing based on Access data
« on: March 14, 2019, 03:33:23 PM »
I am a newbie to Visio.  I have been a CAD designer for over 25 years, so a little different for me.  I created and Access database that would automatically create and modify drawings based on information in Access.  I created a template drawing in AutoCAD and used the graphics as a backdrop in Access reports with the fields placed on top of it.  The users makes there selection and selects the drawing button and depending on what equipment is contained on the called query, it selects the correct template report and populates the data.  That has worked fine for many years, but recently they are requiring more variables added to the drawings which strays away from the normal templates.  I reworked the database to now use Visio and Data links.  So far I can populate the drawings.  The problem I am having is that, say if one of the queries does not contain any equipment for this particular drawing and produces null values I get a conflict.  What I would like to do is have all the shapes (components of any given location) in the drawing and depending on the tables that Access produces, auto toggle layers on and off.  If the table has null value because the equipment is not contained on that location then that layer (say an oil tank) will be turned off.  If the oil tank is present on the location and in the table then it turns the layer on.  This would allow me to have one template instead of 40 and having to code which template to use based on criteria.  I would also like to ignore the conflict error, so the end user will not see it.   Thanks in advance for any help. Keith

Surrogate

  • Hero Member
  • *****
  • Posts: 887
    • ShapeSheet™ Knowledge Base
Re: Dynamic drawing based on Access data
« Reply #1 on: March 14, 2019, 04:59:35 PM »
You need make these steps

AggKat

  • Newbie
  • *
  • Posts: 3
Re: Dynamic drawing based on Access data
« Reply #2 on: March 14, 2019, 05:28:47 PM »
Yes have already connected to my database and populating the shapes with the data from Access.  I am now wanting to do something like and if statement in the shape sheet to say if X is NULL then turn Y layer off, else populate based on Access.

Yacine

  • Hero Member
  • *****
  • Posts: 2542
Yacine

AggKat

  • Newbie
  • *
  • Posts: 3
Re: Dynamic drawing based on Access data
« Reply #4 on: March 15, 2019, 08:37:10 AM »
Thanks for the reply.  I will look at the link and see if I can modify for my needs.

wapperdude

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3426
  • Ideas Visio-lized into solutions
Re: Dynamic drawing based on Access data
« Reply #5 on: March 15, 2019, 09:38:36 AM »
Unless I missed something, seems all you need is extra couple lines of code...As you read database, check for null data and set layer visibility to zero.

Wapperdude
Visio 2019 Pro