Switch nested sub to either datasheet, pivotTable or pivotChart view in Access 2007

Hello all,
I have a main form (aka Form3) with a sub form (aka Form2) in it and another sub form (aka Form1) in that.  From the main form (aka Form3) I want to have the user be able to click a button in an option group and have it switch the view of the nested sub form (aka Form1) to the option they selected.

I tried using something like this:

    Forms![Form3]![Form2]![Form1].SetFocus
    DoCmd.RunCommand acCmdDatasheetView

but it seems to change the main forms view to datasheet rather than the nested sub.  I've tried other variations, but only end up getting an error saying something about the command not being available at this time.

Any ideas?
LVL 2
Cristal638Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Cristal638Author Commented:
Maybe I should make this a little clearer:  Here's a question that was posted on another site by a user back in 2002.  Unfortunately nobody responded with the answer.  Hopefully this won't be the case here.  Anyway here's what the user wrote:

Does anyone know how to toggle a nested subform's view
from datasheet and form. Using a combination of set focus
and the "DoCmd.RunCommand acCmdSubformDatasheet" command
always changes the first level subform.
0
Cristal638Author Commented:
I figured it out...


    Me.Form2.SetFocus
    Me.Form2.Form.cmd1.SetFocus
    Me.Form2.Form.Form1.SetFocus
    Me.Form2.Form.Form1.Form.Parameter.SetFocus

    Select Case Me.TabCtl7
   
    Case 0  'PivotTable View
        Access.RunCommand acCmdSubformPivotTableView
   
    Case 1  'DataSheet View
        Access.RunCommand acCmdSubformDatasheetView
   
    Case 2  'PivotChart View
        Access.RunCommand acCmdSubformPivotChartView
   
    End Select
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.