Results 1 to 13 of 13
  1. #1
    Join Date
    Sep 2014
    Posts
    7

    Visio Viewer Active X control not showing drawing in report

    I have set up a Visio Viewer Active X control in a form and am able to show a Visio Drawing (.vsd file) in it. This is the standard ActiveX control in Access 2013. I want to put this Visio Drawing on a report, but cannot get it to show up in an ActiveX control on an Access Report in report view or print preview. I thought i had a work around by putting my drawing in an ActiveX control on a form then adding the form to the report. This works in Report View, but doesn't work in Print Preview, I just get a blank control. Can anyone help me as to what i may be missing in order to get a Visio Drawing to show up in an ActiveX control in a report? Thanks

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    I don't see Visio Viewer in the list of Active X controls. I do see Microsoft Visio Document. Is that what you are using?

    However, I don't have Visio or a Visio document to test. I will try to get it next day or so.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Join Date
    Sep 2014
    Posts
    7
    You are right, when you add the control it is called Microsoft Visio Document. In the properties for the ActiveX control, the OLE Class is Microsoft Visio Document, and the Class is VisioViewer.Viewer.1. Sorry for the confusion.

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    If you want to provide the .vsd file, will test.

    How is the control associated with document?

    This is a weird control. It won't stay the size I drag it to. Can only resize it in form Layout view.

    But then I've never used any of the ActiveX controls. None I my few experiments with them have been successful.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    Join Date
    Sep 2014
    Posts
    7
    I am not sure what you mean "How is the control associated with document?"

    I have been resizing the control using the OnCurrent Property. In my work around as mentioned earlier, I set all the details (Width, Height, Zoom and use the load method) using the OnCurrent Property. This works fine when the control is in a form or the form is added to a report (in report view but not in print preview). If there is another work around using a different control rather than an ActiveX Control that would be fine. I can send you a sample vsd file, but I am not sure i can do that through this forum. Thanks.

  6. #6
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Attach file to post. If more than 500KB, zip it. 2MB zip allowed. The attachment manager is below the advanced editor window. Click Go Advanced below reply editor.

    If the control is supposed to view a Visio document, how does the control know which document?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  7. #7
    Join Date
    Sep 2014
    Posts
    7
    I have the form (or report) linked to a table. I have a field in the table that stores the location of the vsd file. I use the load method on the ActiveX Control in the OnCurrent property of the form to load the vsd file to the control.
    Attached Files Attached Files

  8. #8
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    I have the document displaying on form and only in design view of report.

    I haven't tried any code yet. Would you post yours? Try it in the report OnFormat event of the section the control is in.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  9. #9
    Join Date
    Sep 2014
    Posts
    7
    Thanks for the reply. I will try code in the OnFormat event tomorrow.

  10. #10
    Join Date
    Sep 2014
    Posts
    7
    Hi June7
    I have tried putting my code in the onFormat event, and still no joy. I also tried a number of other events on the report, both with the drawing loaded directly into an ActiveX control on a report and also with the drawing loaded into an ActiveX control on a form which is placed on a Report.

    This is the code i have in the onCurrent event on the form which seems to load fine on a form.

    Me.axDrawing.Load (Me.DrawingRef)
    Me.axDrawing.Height = 4000
    Me.axDrawing.Width = 8000
    Me.axDrawing.Zoom = 0.8

    Thanks

  11. #11
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Now I can't get SRC property to keep value, how did I manage that before?!?!? Oh, wait, Layout view accepts value in the SRC property. But doesn't save it after form is closed. Bizarre!

    I give up. The code in form works. I can't even get ReportView to display the drawing.

    This is an interactive control (users can modify the drawing), however, reports are not interactive for data editing. Only ReportView can allow for event code. PrintPreview does have right click shortcut menu. Maybe report just cannot handle this control.

    So next question, why do you need report? Do you want to print this drawing?

    Oh, more weirdness - I changed the drawing background color and later deleted the form. When I created a new form and pulled in a new control, it had that color setting.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  12. #12
    Join Date
    Sep 2014
    Posts
    7
    Thanks for all your effort trying to solve this one. The reason i want to put the drawing in a report is so that i can put some header and footer information from my database onto the drawing without the designers having to enter it onto the top of the drawing in the vsd file. We find that the information gets out of sync between the database and the drawing if something changes. We dont want to have to update it in two places. I was not able to put the visio drawing directly onto a report either. I put it into a form and then put the form onto the report. Worked nicely in report view, but not in print preview.

    Next option is to try another work around....... Any suggestions?

    Another option i tried (very dodgy) was to do a print screen in VBA of a form with the drawing in it. I was then trying to save the image off the clipboard to some kind of image file and then load that into a report. I was able to get an image of the form onto the clipboard, but was not able to save the image off the clipboard using VBA.

    I will go back to the (visio) drawing board (pardon the pun) and see if there is another way i can achieve what i am trying to do. Thanks for your help

  13. #13
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    I still don't understand why you would use a report for that. You want to modify the drawing and commit those changes in the vsd file?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Active X control comes grayed out
    By jj1 in forum Access
    Replies: 1
    Last Post: 05-29-2014, 09:13 AM
  2. Report drawing from multiple tables
    By Palladian in forum Reports
    Replies: 3
    Last Post: 10-08-2012, 04:11 PM
  3. Updating a Visio drawing through Access
    By jmejorada360 in forum Import/Export Data
    Replies: 1
    Last Post: 08-10-2012, 12:03 PM
  4. Editing Visio drawing in Form view
    By jmejorada360 in forum Import/Export Data
    Replies: 2
    Last Post: 08-10-2012, 10:15 AM
  5. MODI Viewer Control
    By TomBra in forum Programming
    Replies: 0
    Last Post: 04-03-2009, 02:59 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums