Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Change Form View

Posted on 2003-12-10
16
446 Views
Last Modified: 2010-08-05
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
0
Comment
Question by:Y2Kingswood
  • 7
  • 4
  • 3
  • +1
16 Comments
 
LVL 3

Expert Comment

by:DMurray
ID: 9916892
Easy peasy

do this

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

DMurray
0
 

Author Comment

by:Y2Kingswood
ID: 9916946
its a subform :P
0
 
LVL 10

Expert Comment

by:perkc
ID: 9916963
Try:

DoCmd.RunCommand acCmdSubformFormView

or

DoCmd.RunCommand acCmdFormView

perkc
0
Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

 

Author Comment

by:Y2Kingswood
ID: 9917010
they both just do nothing :P
0
 
LVL 3

Expert Comment

by:DMurray
ID: 9917225
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
 

Author Comment

by:Y2Kingswood
ID: 9917352
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
 
LVL 3

Expert Comment

by:DMurray
ID: 9917368
And youw ant to change it from Form Normal view to datasheet view at a touch of a butotn?
0
 
LVL 10

Expert Comment

by:perkc
ID: 9920592
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
 

Author Comment

by:Y2Kingswood
ID: 9923899
what is the acCmd for Contionus form and single form?
0
 

Author Comment

by:Y2Kingswood
ID: 9924392
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
 
LVL 10

Expert Comment

by:perkc
ID: 9924643
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
 

Author Comment

by:Y2Kingswood
ID: 9924677
yeah i am having the same trouble. and when i use echo it still shows the from closing and opening :(
0
 
LVL 10

Accepted Solution

by:
perkc earned 50 total points
ID: 9928507
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
 

Author Comment

by:Y2Kingswood
ID: 9938363
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
 
LVL 32

Expert Comment

by:jadedata
ID: 10294001
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

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Rounding precision in MS Access 9 53
Dinamic report to Crosstab query 9 31
default combobox value 12 17
How open a file when clicking on a text field 7 18
Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…

790 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question