Solved

Save Subform design changes

Posted on 2010-11-24
4
647 Views
Last Modified: 2012-05-10
How do I save a Subform design change via vba ?
Subform is Datasheet view, changes are made via vba, and I want to save these subform design changes.
The main code changes ConditionalFormatting on the subform, and it is these changes I want saved.
MS Access environemts 2003 and greater.
0
Comment
Question by:ReefIT
[X]
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
  • 2
4 Comments
 
LVL 30

Expert Comment

by:hnasr
ID: 34210328
In general to save form changes, DoCmd.Save acForm,"frmName"

0
 
LVL 1

Author Comment

by:ReefIT
ID: 34210728
That works for the MainForm, but it's not working for the SubForm on the MainForm as the SubForm is only a object on the MainForm
0
 
LVL 30

Accepted Solution

by:
hnasr earned 250 total points
ID: 34211018
You may let access help in saving the subform, by closing the main form:

Private Sub Command1_Click()
    DoCmd.SetWarnings False
    DoCmd.Close acForm, Forms!mainForm.Name, acSaveYes
    DoCmd.SetWarnings True
End Sub
0
 
LVL 85

Assisted Solution

by:Scott McDaniel (Microsoft Access MVP - EE MVE )
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 250 total points
ID: 34216579
IMO, you'd be much better off running the code that changes the CF each time that Form is run instead of trying to save design changes at runtime. This will decompile your database, leaving it potentially more unstable. Granted you can Compile/Compact each time, but that's very intrusive. It also means you can't deploy a .mde file (which is the preferred format).
0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

687 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