G
Guest
Hi.
I am struggling to figure out just how to capture the name of an open form,
and store that name as a variable to set the open form's properties.
For example, I want to avoid using this kind of code:
---
Private Sub Form_Open(Cancel As Integer)
Dim stFrmCaption As String 'stores caption for this form
Forms!frm_ViewData_Fish_Sites.Caption = stFrmCaption
End Sub
---
I want to replace "Forms!frm_ViewData_Fish_Sites.Caption = stFrmCaption"
with a simple statement that refers to the currently open form -- regardless
of what the form's name is. This way I can create copies of the form and not
have to edit the code all the time.
What code should I use?
I am struggling to figure out just how to capture the name of an open form,
and store that name as a variable to set the open form's properties.
For example, I want to avoid using this kind of code:
---
Private Sub Form_Open(Cancel As Integer)
Dim stFrmCaption As String 'stores caption for this form
Forms!frm_ViewData_Fish_Sites.Caption = stFrmCaption
End Sub
---
I want to replace "Forms!frm_ViewData_Fish_Sites.Caption = stFrmCaption"
with a simple statement that refers to the currently open form -- regardless
of what the form's name is. This way I can create copies of the form and not
have to edit the code all the time.
What code should I use?