Hi,
I have a form frmTherapyDetails that contains a subform placeholder called SbFrmSubForm. This subform's source object changes depending on the user's selection from a combobox on the main form. Having one of these subform's open is a requirement in order for another form to be opened when a button on this subform is clicked. So, in other words, the sourceobject for one subform is "Tracheostomy/Stoma". On this subform is a button that when clicked opens another form called frmCorkingDetails. But in order for frmCorkingDetails to open, the subform Tracheostomy/Stoma must be open. When I use the following code on frmCorkingDetails Form_Open, it's not recognizing that the subform is open:
Private Sub Form_Open(Cancel As Integer)
If Not IsLoaded("Tracheostomy/Stoma") Then
MsgBox "Open the Corking Details form using the Corking Details button on the Tracheostomy/Stoma form."
Cancel = True
End If
End Sub
I know that the subform is not recognized as a form in the forms collection, and I have tried various changes in the syntax to refer to this particular form when displayed as a subform on the main form. I've tried:
If Not IsLoaded(forms![frmTherapyDetails]![SbFrmSubForm].SourceObject = "Tracheostomy/Stoma") Then
etc....
Doesn't work. I've tried:
If Not IsLoaded(forms![frmTherapyDetails]![SbFrmSubForm]![Tracheostomy/Stoma].SourceObject) Then
etc...
No go. I've also tried:
If Not IsLoaded(forms![frmTherapyDetails]![Tracheostomy/Stoma].SourceObject) Then
and this:
Dim strTrachSbFrm As String
strTrachSbFrm = [Forms]![frmTherapyDetails]![SbFrmSubForm].SourceObject = "Tracheostomy/Stoma"
If Not IsLoaded(strTrachSbFrm) Then
MsgBox "Open the Corking Details form using the Corking Details button on the Tracheostomy/Stoma form."
Cancel = True
End If
Still not working. I just can't figure out the proper syntax to refer to this specific subform. Any ideas?
Thanks
I have a form frmTherapyDetails that contains a subform placeholder called SbFrmSubForm. This subform's source object changes depending on the user's selection from a combobox on the main form. Having one of these subform's open is a requirement in order for another form to be opened when a button on this subform is clicked. So, in other words, the sourceobject for one subform is "Tracheostomy/Stoma". On this subform is a button that when clicked opens another form called frmCorkingDetails. But in order for frmCorkingDetails to open, the subform Tracheostomy/Stoma must be open. When I use the following code on frmCorkingDetails Form_Open, it's not recognizing that the subform is open:
Private Sub Form_Open(Cancel As Integer)
If Not IsLoaded("Tracheostomy/Stoma") Then
MsgBox "Open the Corking Details form using the Corking Details button on the Tracheostomy/Stoma form."
Cancel = True
End If
End Sub
I know that the subform is not recognized as a form in the forms collection, and I have tried various changes in the syntax to refer to this particular form when displayed as a subform on the main form. I've tried:
If Not IsLoaded(forms![frmTherapyDetails]![SbFrmSubForm].SourceObject = "Tracheostomy/Stoma") Then
etc....
Doesn't work. I've tried:
If Not IsLoaded(forms![frmTherapyDetails]![SbFrmSubForm]![Tracheostomy/Stoma].SourceObject) Then
etc...
No go. I've also tried:
If Not IsLoaded(forms![frmTherapyDetails]![Tracheostomy/Stoma].SourceObject) Then
and this:
Dim strTrachSbFrm As String
strTrachSbFrm = [Forms]![frmTherapyDetails]![SbFrmSubForm].SourceObject = "Tracheostomy/Stoma"
If Not IsLoaded(strTrachSbFrm) Then
MsgBox "Open the Corking Details form using the Corking Details button on the Tracheostomy/Stoma form."
Cancel = True
End If
Still not working. I just can't figure out the proper syntax to refer to this specific subform. Any ideas?
Thanks