Because of timing issues, it's usually best to set the SourceObject of a
subform via programming in the main form that contains the subform. Pass the
name of the SourceObject to the main form via the OpenArgs argument of
DoCmd.OpenForm action, and then use that in the form's Load event to set the
subform's SourceObject.
Concatenate all the text values into one string, but put a delimiter between
them. I usually use the pipe (|) character.
Then you can parse out the OpenArgs string into the separate names in the
opened form.
Here's some sample code:
(in the calling form)
Dim strOpenArgs As String
strOpenArgs = "SourceObjectName" & "|" & "LabelText" & _
"|" & "CaptionText"
DoCmd.OpenForm "MainForm", OpenArgs:=strOpenArgs
(in the main form that is called)
Dim varOpenArgs As Variant
varOpenArgs = Split(Me.OpenArgs, "|")
' varOpenArgs(0) contains the "SourceObjectName"
' varOpenArgs(1) contains the "LabelText"
' varOpenArgs(2) contains the "CaptionText"