Private Function LoadSubform()
Dim sSubForm As String
sSubForm = aSubforms(Nz(ItemTypeID, 0))
With Forms!frmCompanies!sbfSubClass
If .SourceObject <> sSubForm Then
.SourceObject = sSubForm
End If
.Requery
End With
The array is defined in a Form_Load event:
Private Sub Form_Load()
aSubforms = Array("", "fsubBaseUnits", "fsubPrinters",
"fsubMonitors")
End Sub
Instead of using an array, I'd like to store these form names in a
table (tblItemTypes.FormName), and reference the form names from the
table instead. How do I adjust my code (presumably the sSubforms = ...
line to make this happen?
Thank you.