Show a subform based on data in subform

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.
 
S

stumac

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
 
M

Mannie G

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top