Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Pass values from a table to a dimensioned variable

2 views
Skip to first unread message

Kurt

unread,
May 8, 2011, 1:13:49 AM5/8/11
to
I'm defining an array of form names, and referring to the array later
like so:

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.

0 new messages