Hi
I have a main form and want to put two subforms on a tabbed control (on the same tab)
Subform 1 will display data if it corresponds with the data on the main form. When this is true, subform 2 will be blank
Likewise, subform 2 will display data if it corresponds with the data on the main form and when this is true, subform1 will be blank.
How can I make the subforms visible only when there is data present?
I have only worked with one subform at this stage and this is what I have tried:
This code is attached to one of the subforms on the tabbed control.
txtLumpSumTot is a calculated textfield on the subform but I have tried other fields. I also tried the same code on the OnDirty property.
The subform either is hidden or visible depending if I swap the true and false status around.
I have a main form and want to put two subforms on a tabbed control (on the same tab)
Subform 1 will display data if it corresponds with the data on the main form. When this is true, subform 2 will be blank
Likewise, subform 2 will display data if it corresponds with the data on the main form and when this is true, subform1 will be blank.
How can I make the subforms visible only when there is data present?
I have only worked with one subform at this stage and this is what I have tried:
Code:
Private Sub Form_Open(Cancel As Integer)
If (IsNull(txtLumpSumTot)) Then
Forms!afrmProjectReview!subfrmPJLSEstimate.Form.Visible = True
Else
Forms!afrmProjectReview!subfrmPJLSEstimate.Form.Visible = False
End If
End Sub
txtLumpSumTot is a calculated textfield on the subform but I have tried other fields. I also tried the same code on the OnDirty property.
The subform either is hidden or visible depending if I swap the true and false status around.
Comment