i use this VBA code in main form on current to hide subforms with no records.
this particular main form has 4 subforms so I am using a tabcontrol to place the forms in. The 1st main form (not shown in code) always has records..the other 3 may or may not
the first on and the last one have table record sources
the middle on is a query
the VBA doesn't work on the main form that has the tab control?
no errors
Private Sub Form_Current()
With Me![sfViewSlmnNotes].Form
.Visible = (.RecordsetClone.RecordCount > 0)
With Me![RQTHISTORYsf].Form
.Visible = (.RecordsetClone.RecordCount > 0)
With Me![frmsfTedsLine2].Form
.Visible = (.RecordsetClone.RecordCount > 0)
End With
End With
End With
ideally - I would like to hide the page altogether so that the user will not be looking in them when there are no records
does anyone know how I would modify this to work?
this particular main form has 4 subforms so I am using a tabcontrol to place the forms in. The 1st main form (not shown in code) always has records..the other 3 may or may not
the first on and the last one have table record sources
the middle on is a query
the VBA doesn't work on the main form that has the tab control?
no errors
Private Sub Form_Current()
With Me![sfViewSlmnNotes].Form
.Visible = (.RecordsetClone.RecordCount > 0)
With Me![RQTHISTORYsf].Form
.Visible = (.RecordsetClone.RecordCount > 0)
With Me![frmsfTedsLine2].Form
.Visible = (.RecordsetClone.RecordCount > 0)
End With
End With
End With
ideally - I would like to hide the page altogether so that the user will not be looking in them when there are no records
does anyone know how I would modify this to work?