joyfullservice / msaccess-vcs-addin

Synchronize your Access Forms, Macros, Modules, Queries, Reports, and more with a version control system.
Other
215 stars 40 forks source link

Build Database from Source on different System disabeld the Design Property of the Control Elements #318

Open CarolusMagnuss opened 2 years ago

CarolusMagnuss commented 2 years ago

Discussed in https://github.com/joyfullservice/msaccess-vcs-integration/discussions/312

Originally posted by **CarolusMagnuss** March 25, 2022 Hello again, i am still very happy with the plugin and have now used it to make my development changes available to our partner in another city. We have set up a local git-management application which pulls my changes from the server and the plugin does its job of building the database from the sourcefiles. The functionality is fine, however for some reason the UseTheme Property of all Controll Elements changed to False on her machine. Meaning it doesn't use the custom design and just shows gray buttons. Setting the Property for all Elements in all Forms to True by Hand after every update is clearly not the way to go. I haven't encountered this on the other machines where i build the database from source, is there a global setting i am missing? Regards

After getting more Feedback from my partner, its not just the UseTheme Property which gets set to false, All related Format Properties are also set to a Default. Colour when Button is pushed is white for instance.

I tried exporting Themes with the database, but it didn't help

Any ideas`?

hecon5 commented 2 years ago

Themes can be a bit finicky with Access; the Addin has also changed how Themes import/export and apply to UI elements (controls/forms/reports...).

A few low-level fruit items to check:

  1. Verify Theme setting is correct (and the same on both machines); I advise you set Extract Theme Files to OFF.
  2. Ensure you and your partner both have the SAME Addin build version. While most changes shouldn't affect the build version, it's possible there's changes which lead to other headaches.
  3. For sanity, we commit the vcs-options.json file to the repo; this will ensure all developers are using the same options settings for consistency.
  4. Do a full export after verifying above; there's potential the theme isn't being properly exported, this is unlikely, but possible.
  5. Verify the Theme is correctly importing on their machine; I've had instances where the Theme wasn't importing, and it just used some other theme set.
  6. There is a potential the control's theme data is mangled on the internal form; this will not be detectable on the primary machine in my experience, but others who build the borked code will show the wrong theme applied, see #183 for details, but you may benefit from using modRepair.RepairColorDefinitionBlocks on your database followed by a FullExport.
joyfullservice commented 2 years ago

@CarolusMagnuss - Another thing you might check into is the setup of a default database. Allen Brown has a great article on creating default forms, reports and databases that very possibly may solve the issue you are encountering by ensuring that you and your coworker are using a default database with the same configuration.

CarolusMagnuss commented 2 years ago

@joyfullservice Thanks a lot I think you are on the right track.

The way I see it, the AddIn Creates a completely new Database from the source files, using the default settings for databases on the local machine.

This includes the default properties for each control type, which you can set by clicking on the control type in the Toolbox and having the properties Window open.

I can set these defaults for a control type within a database but i haven't figured out how to save these defaults so that they are used persistently in all new databases.

Do you have any ideas, where these settings are stored?

Ik-12 commented 2 years ago

At least based on my experience there is a bug in Access with the handling of UseTheme property. The property is reset to False if a form is created using LoadFromText function or a new instance of the form is created using the New operator (i.e., Set newForm = New Form_XXX).

As a workaround I restore the UseTheme property in the import hook of the addin, but assuming that this bug affects most versions of Access, it would be nice if the addon would handle this automatically (I’m using version 16.0.4266.1001/64bit). Btw. this has been already discussed in #170 and #41.