Hi Everyone.
In my access app VBA code, I very often use the same form names for reference in fuctions or methods, here's example from my code, in public Module:
I use the form reference "Forms!frmMain!sfrmPanelDate.Form" (or any other reference) many times in the app code, and if I decide to change the forms/subform structure, I need to change the reference each instance it's used.
Isn't there somehow, maybe through class module, where the reference name would be created, to only have to change the form name reference once to change the reference for all places it used?
Thanks,
inso18
In my access app VBA code, I very often use the same form names for reference in fuctions or methods, here's example from my code, in public Module:
Code:
Function fColorAmount()
If flgFrmMainIsLoaded Then
If Not IsNull([b]Forms!frmMain!sfrmPanelDate.Form!sfrmPanelColor.Form.ctlColorAmount[/b]) Then
fColorAmount = [b]Forms!frmMain!sfrmPanelDate.Form!sfrmPanelColor.Form.ctlColorAmount[/b]
Else
fColorAmount = "*"
End If
Else
fColorAmount = "*"
End If
End Function
Function fHighLights()
If flgFrmMainIsLoaded Then
If Not IsNull([b]Forms!frmMain!sfrmPanelDate.Form!sfrmPanelColor.Form.ctlHighLights[/b]) Then
fHighLights = [b]Forms!frmMain!sfrmPanelDate.Form!sfrmPanelColor.Form.ctlHighLights[/b]
Else
fHighLights = "*"
End If
Else
fHighLights = "*"
End If
End Function
I use the form reference "Forms!frmMain!sfrmPanelDate.Form" (or any other reference) many times in the app code, and if I decide to change the forms/subform structure, I need to change the reference each instance it's used.
Isn't there somehow, maybe through class module, where the reference name would be created, to only have to change the form name reference once to change the reference for all places it used?
Thanks,
inso18