Referencing subforms

hiwelcome

Registered User.
Local time
Today, 09:05
Joined
Aug 14, 2015
Messages
47
Hello,

I'm currently using this bit of code previously provided by a helpful someone to open two forms for data entry on one page (i.e. Choose A, choose B, click open and form (built with two blank subforms) opens with FormA next to FormB):


Private Sub Form_Load()
Dim arrSplit As Variant
With Me

If Len(Nz(.OpenArgs)) <> 0 Then

arrSplit = Split(.OpenArgs, "|")

.FormA.SourceObject = arrSplit(0)
.FormB.SourceObject = arrSplit(1)

End If

End With
End Sub


I was looking to slightly modify this on a form where I have subforms within a tabbed control. Meaning I would now like the page to open with four forms - two subforms on each tab. Can someone help me with how to modify the referencing in the code to do this? Right now the button/on click code looks like:

If Me.ComboDiscipline = "ADP" And Me.ComboState = "Alabama" Then
DoCmd.OpenForm "FrmMain", , , , , , "FrmEntryADPField|FrmAlabama"
 
If it helps, a Tab control does not affect the syntax. Each SubForm on the entire MainForm must have a unique name since they are really all on the same MainForm.
 

Users who are viewing this thread

Back
Top Bottom