subform filters

S

seeker

I have a form frmHealthStatsInitial which has a combo box cmbMemberName and a
subform subfrmHealthstats which is based on frmhealthstats. I want the
member chosen health stats to show in the subform but all data in the query
of subform shows. I have tried
Private Sub cmbMemberName_AfterUpdate()
subfrmHealthStats.Visible = True
subfrmHealthStats!MemberNumber = cmbMemberName.Value
subfrmHealthStats.Requery
End Sub
I have tried putting forms!frmhealthstatsinitial!cmbmembernumber in the
criteria of membernumber field in query that subform is based.

both ways do not filter data to a specific member. What am I missing.
Thanks.
 
M

Marshall Barton

seeker said:
I have a form frmHealthStatsInitial which has a combo box cmbMemberName and a
subform subfrmHealthstats which is based on frmhealthstats. I want the
member chosen health stats to show in the subform but all data in the query
of subform shows. I have tried
Private Sub cmbMemberName_AfterUpdate()
subfrmHealthStats.Visible = True
subfrmHealthStats!MemberNumber = cmbMemberName.Value
subfrmHealthStats.Requery
End Sub
I have tried putting forms!frmhealthstatsinitial!cmbmembernumber in the
criteria of membernumber field in query that subform is based.

both ways do not filter data to a specific member. What am I missing.


I'm not clear on what you are trying to accomplish, but it
seems like you should be using the subform control's
LinkMaster/Child properties instead of all that other stuff.
I think you want LinkMaster to be the combo box and
LinkChild to be the MemberNumber field.
 
M

Marshall Barton

Only the subform needs to be bound. Are you sure you set
LinkChild to the record source field and not a control?
 

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