Output muliple views to PDF

H

Humphrey

I'm getting there...

I'm trying to iterate between all the views in the form and print each view
to PDF via code.

allViews = Me.ViewInfos

For a = 0 To allViews.Count - 1
strViewName = Me.ViewInfos(a).Name
Me.ViewInfos.SwitchView(strViewName)
.....
Next
The code itself seems to work in that it will select the name of each of the
views in turn in the strViewName variable, however the switchview only works
for the first item through the loop. In this case it is the data entry view.
The data presentation views are never selected.
What am I missing here? I read somewhere you can only change the view once
in code but this would not make sense. Any help would be appreciated.

H
 
G

Greg Collins

Your not missing anything... there can only be one view switch at a time.
View switching while another view switch is going on is not allowed. A view
switch is not complete until all code has finished, etc, and the view
finishes drawing itself.

You might look into the OnContextChange event handler and write some code in
there to perform what you want. A context change occurs after the view
switch is complete.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top