?
Solved

Save Subform design changes

Posted on 2010-11-24
4
Medium Priority
?
668 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 1000 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 1000 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
Suggested Courses

770 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