Y2Kingswood
asked on
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
i want to change the view of the form to single form when a button is clicked.
Thanks
ASKER
its a subform :P
Try:
DoCmd.RunCommand acCmdSubformFormView
or
DoCmd.RunCommand acCmdFormView
perkc
DoCmd.RunCommand acCmdSubformFormView
or
DoCmd.RunCommand acCmdFormView
perkc
ASKER
they both just do nothing :P
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
DMurray
ASKER
yup no problem!
The main form is called
MenuMain_F
the subform control is called MenuSubForm
and the subform form is called
MenuMainClassList_F
The main form is called
MenuMain_F
the subform control is called MenuSubForm
and the subform form is called
MenuMainClassList_F
And youw ant to change it from Form Normal view to datasheet view at a touch of a butotn?
OK, sorry but the following will switch views on the subform every time you press the button.
Me!SUBFORMNAME.SetFocus
DoCmd.RunCommand acCmdSubformDatasheet
perkc
Me!SUBFORMNAME.SetFocus
DoCmd.RunCommand acCmdSubformDatasheet
perkc
ASKER
what is the acCmd for Contionus form and single form?
ASKER
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
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
Sorry but I havn't had any luck finding a method to switch between continuous and single form view without closing the form.
perkc
perkc
ASKER
yeah i am having the same trouble. and when i use echo it still shows the from closing and opening :(
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
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
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
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
do this
doCmd.close acForm "name of form"
DoCmd.openForm "NameofForm", acDatasheet (or whatever the view is that you want)
DMurray