Hi,
I'm having a problem referring to controls on sub forms, below is the schema of how my forms are arranged:
Main Form
TabControl
Private Sub TabCtl0_Change()
Select Case Me.TabCtl0.Value
Case 0
Me.SubFormContainer.SourceObject = "SubForm1"
Case 1
Me.SubFormContainer.SourceObject = "SubForm2"
End Select
End Sub
Note: I think part of my problem is referring to controls on SubForm2 when it's not the SubFormContainer.SourceObject - ie. SubForm1 is loaded
SubFormContainer
Sub Form 1
Sub Form 1A - Continuous Form
Button- btnCopyMemp
Private Sub btnCopyMemp_Click()
If IsNull(SubForm2a.txtComplaint) Then
SubForm2A.txtComplaint = SubForm1A.txtComplaint
End If
End Sub
TextBox - txtComplaint
TextBox - txtPrep
TextBox - txtAdmin
Sub Form 1B - Continuous Form
Sub Form 2
Sub Form 2A
TextBox - txtComplaint
Sub Form 2B - Continuous Form
TextBox - txtPrep
TextBox - txtAdmin
How do I refer to the subform controls - in red- in the code for btnCopyMemp_Click() above?
I also need to copy txtPrep and txtAdmin from SubForm 1A to SubForm 2B - help referencing these controls also appreciated
Sorry lost indentation in above schema, hope it's still clear.
Thanks for any help
David