Show a subform based on data in subform

  • Thread starter Thread starter Mannie G
  • Start date Start date
M

Mannie G

I have a database for members of an organisation some of whom belong to
sub-committees (of which there are many). On the main 'Members' form there
is a 'Committees Subform shown. How can I hide the subform if the member
does not belong to any of the committees?

Your suggestions would be appreciated.
 
Hi Mannie - you could use the 'on current' event of the form to check if
there is any records in the sub-committee table and hide the subform if no -
something like:

If DCount("*", "SubCommittee", "[memberID] = " & Me.memberID) > 0 Then
Me.mysubform.Visible = True
Else
Me.mysubform.Visible = False


Obviously you need to put the correct table, field and subform names in.

Hth
Stu
 
Great, thanks -all working well.
--
Thanks

Mannie G


stumac said:
Hi Mannie - you could use the 'on current' event of the form to check if
there is any records in the sub-committee table and hide the subform if no -
something like:

If DCount("*", "SubCommittee", "[memberID] = " & Me.memberID) > 0 Then
Me.mysubform.Visible = True
Else
Me.mysubform.Visible = False


Obviously you need to put the correct table, field and subform names in.

Hth
Stu

Mannie G said:
I have a database for members of an organisation some of whom belong to
sub-committees (of which there are many). On the main 'Members' form there
is a 'Committees Subform shown. How can I hide the subform if the member
does not belong to any of the committees?

Your suggestions would be appreciated.
 
Back
Top