Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

properly instantiate UserForms #411

Open
37 of 42 tasks
AronGahagan opened this issue Oct 17, 2024 · 0 comments
Open
37 of 42 tasks

properly instantiate UserForms #411

AronGahagan opened this issue Oct 17, 2024 · 0 comments
Assignees

Comments

@AronGahagan
Copy link
Owner

AronGahagan commented Oct 17, 2024

Problems:

  1. Evidently I have not been properly instantiating UserForms; working directly on the class instead of with an instance. e.g.,
With cptStatusSheet_frm
...
End With
  1. Modeless UserForms are not properly hidden/unloaded.
  2. Modal UserForms are not properly hidden/unloaded.
  3. UserForms are not always properly unloaded from memory.
  4. QueryClose is unused.

Solutions:

  • 1. Properly instantiate.
Set myStatusSheet_frm = New cptStatusSheet_frm
With myStatusSheet_frm
...
End With
  • 2. With ([UserForm].Show 0 '0 = False = VBA.FormShowConstants.vbModeless): use Me.Hide within form's code; use Unload Me in UserForm_Terminate Event.
  • 3. With ([UserForm].Show 1 '1 = True = VBA.FormShowConstants.vbModal): use Me.Hide within form's code; use Unload from the calling module.
  • 4. In both instances, the UserForm should be cleared from memory (Set [UserForm] = Nothing) unless the calling subroutine needs it again (hint: if the subroutine has a (ByRef [myUserForm] As [cptUserForm]) variable, then do not kill it).
  • 5. If CloseMode = vbQueryClose.vbFormControlMenu Then / Me.Hide / Cancel = True / End IF

UserForms subject to this change:

  • cptAbout_frm
  • cptAdjustment_frm
  • cptAgeDates_frm
  • cptBackbone_frm
  • cptCalendarExceptions_frm
  • cptCostRateTables_frm
  • cptDataDictionary_frm
  • cptDECM_frm
  • cptDECMTargetUID_frm
  • cptDynamicFilter_frm
  • cptFilterByClipboard_frm
  • cptFiscal_frm
  • cptIntegration_frm
  • cptMetricsData_frm
  • cptNetworkBrowser_frm
  • cptQBD_frm pre-release
  • cptResetAll_frm
  • cptResourceDemand_frm
  • cptSaveLocal_frm
  • cptSaveMarked_frm
  • cptSettings_frm
  • cptSmartDuration_frm
  • cptStatusSheet_frm
  • cptStatusSheetImport_frm
  • cptTaskHistory_frm
  • cptText_frm
  • cptUpgrades_frm

Todo:

  • assign this issue
  • label the issue for enhancement or bug
  • label the issue with codemodule (so fixes can be aggregated and hotfixed together)
  • checkout appropriate branch and create topic branch
  • design, code and test
  • update codemodule <cpt_version>x.y.z</cpt_version>
  • update CurrentVersions.xml manually
  • commit changes prefix comment with Issue #XXX -
  • merge topic into appropriate branch(es) and push
  • delete topic branch
@AronGahagan AronGahagan self-assigned this Oct 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant