Change Form View

How do i change the view of a form in vba?
i want to change the view of the form to single form when a button is clicked.

Thanks
Y2KingswoodAsked:
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.

DMurrayCommented:
Easy peasy

do this

doCmd.close acForm "name of form"
DoCmd.openForm "NameofForm", acDatasheet (or whatever the view is that you want)

DMurray
0
Y2KingswoodAuthor Commented:
its a subform :P
0
perkcCommented:
Try:

DoCmd.RunCommand acCmdSubformFormView

or

DoCmd.RunCommand acCmdFormView

perkc
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Y2KingswoodAuthor Commented:
they both just do nothing :P
0
DMurrayCommented:
Do you think you could go into a bit more depth? of what what the name of the forms are (the name of the subform, the name of its parent form ) Might be ab it easier to help you with your problem..

DMurray
0
Y2KingswoodAuthor Commented:
yup no problem!

The main form is called

MenuMain_F

the subform control is called MenuSubForm

and the subform form is called

MenuMainClassList_F
0
DMurrayCommented:
And youw ant to change it from Form Normal view to datasheet view at a touch of a butotn?
0
perkcCommented:
OK, sorry but the following will switch views on the subform every time you press the button.

Me!SUBFORMNAME.SetFocus
DoCmd.RunCommand acCmdSubformDatasheet

perkc
0
Y2KingswoodAuthor Commented:
what is the acCmd for Contionus form and single form?
0
Y2KingswoodAuthor Commented:
you see i have a form, on that form is a subform.
the subform is normaly in Cont Form View.
but on the press of a button must chane to Single Form
when another button is pressed it must change back to Cont Form View
0
perkcCommented:
Sorry but I havn't had any luck finding a method to switch between continuous and single form view without closing the form.

perkc
0
Y2KingswoodAuthor Commented:
yeah i am having the same trouble. and when i use echo it still shows the from closing and opening :(
0
perkcCommented:
You could try having to forms(for use as subforms) created. One in continuous form view and the other in single form view. Then just change the source object property of the subform control on your main form when the user clicks on a button.

Not what you wanted but it might suit your needs.

perkc
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
Y2KingswoodAuthor Commented:
the thing with doing it that way (the way it currently does) is that if i change one form then i have either recreate the other one or make the changes to both forms and its wasting a lot of time, as well as there being 10 or so forms that change view
0
jadedataMS Access Systems CreatorCommented:
No comment has been added lately, so it's time to clean up this TA.
I will leave the following recommendation for this question in the Cleanup topic area:

Accept: perkc {http:#9928507}

Please leave any comments here within the next seven days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

jadedata
EE Cleanup Volunteer
0
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.