Hello
Go to the open event of the form. In form properties uner event choose code builder
make sure you have the dao 3.51 (access97) or dao3.6(access 2000) object libraries (on the menu bar in the code window select tools then references)
paste this code into the form open
when the form opens the subform will disappear if there are no records to be displayes
Dim rst As DAO.Recordset
'change the name of the subform to yours
' me = main form
' SELECT_HOSP_SPELL_FRM = sub form
Set rst = Me.SELECT_HOSP_SPELL_FRM.Form.RecordsetClone
if rst.RecordCount = 0 then
Me.SELECT_HOSP_SPELL_FRM.Form.Visible = False
end if
set rst = nothing
Chris