I created a generic "Open Form" prodedure that will do some standard formatting to a form before it opens. Worked great when forms were bound. However, I'm switching over to an OOD and need to pass objects into a form. The best way I've come up with is have a public subroutine within the form's module.
When I've explicitly called the subroutine (i.e. Set frmForm = FORM_frmWhatever), I can call the subroutine. However, when I try to call the subroutine from a generic Form object, I get a "Application-Defined Error." Any help would be appreciated.
Sub OpenForm(strFormName as string, Optional objObject as Object)
dim frmFrom as form
set frmform = forms(strformname)
If Not objObject Is Nothing Then
frmForm.CustomSub 'Application Error Here
frmform.visible = true