Combo Box with subform

G

Guest

I am working with a subform. I want to use a combo box that displays the
subform for the item selected. For example, if I select green in the combo
box, I want to see all of the green records in the subform. The subform
should not show any records until a selection is made in the combo box. I've
done this before, but now I can't seem to get it to work. Can you help??
Thanks!
 
P

patrick

couple of thoughts:

1.

With Me![Duplicates].Form
.Visible = (.RecordsetClone.RecordCount > 0)
End With

With Me![Quality control spikes].Form
.Visible = (.RecordsetClone.RecordCount > 0)
End With
add the above code to the 'on current' event property for
the form where the sub forms are contained. this will
hide the sub form if the are no records to be displayed.

2. remember the link fields in properties for the sub
form and main form, u need also to set these so that a
field(s) are (is) linked across the sub and main form.
just link the field in the combo box (the actual
fieldname on the form, and a corresponding field in the
sub form
 

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