Saving Form Field Properties

  • Thread starter Thread starter cmcnaught
  • Start date Start date
C

cmcnaught

Guest
I am working on a form using VBA to set field properties from a combo box (background color). The form works fine but the properties do not persist after closing the form. If a manual (toolbar) change is made this forces a save when closing and then the VBA changed properties are saved. I tried using DoCmd.Save acForm, "frmName" on close but this does not save the changed properties either although I know it runs when the form is closed. The form property "Allow Design Changes" is set to "All Views" although I have tried the other setting. Is there a flag that needs to be set to force the property changes to be stored on closing the form? Any other suggestions?
 
I've never tried this myself, but here's an idea. Create a table to store the properties you want to set for your form. Then, when the VBA code sets the properties on the form, have it also update the table. Code the forms OnOpen event to set the properties based on that table and you should be all set. I hope this helps.

~Abby
 
Thanks, Abby N. I followed your suggestion. The properties are on a per record basis so that made sense. Because of that I needed to set them with an onCurrent event (took me a while to figure that out, the documentation isn't very clear). It all works now, thanks again.
 

Users who are viewing this thread

Back
Top Bottom