joyfullservice / msaccess-vcs-addin

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

Missing export for form event code #373

Closed samsquared closed 1 year ago

samsquared commented 1 year ago

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

Originally posted by **samsquared** November 30, 2022 I've successfully installed the add-in (works nicely, thank you) and did an export. Everything seems to be there except code for my form events. These appear in VBA under my database, "Microsoft Access Class Objects" with separate modules for each form containing event code with the name Form_myformname. General VBA code appearing under "Modules" was exported. Is there another option I need to check? Thanks.
hecon5 commented 1 year ago

The form and form code appear in the same folder, just below it.

Open up "YourDBNName.accdb.src"\forms and open one of the files. The top of the file should be the layout/fields/etc. then later on you'll see something like this.

CodeBehindForm`
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
joyfullservice commented 1 year ago

Yes, exactly. When Microsoft Access exports a form, the form definition and the source code are combined into the same text file. The form definition is on top, and the source code at the bottom of the file. This add-in saves the form source files in \forms\*.bas.

samsquared commented 1 year ago

Thank you both very much for the quick reply! Yes, I see the code now. I'd done a search looking for some specific code but it didn't find it for some reason. I'll be putting the exports into Perforce (now Helix).

hecon5 commented 1 year ago

If this is answered, can you close it @samsquared ?

samsquared commented 1 year ago

Gladly. Thanks again.