adp form question - filtering data in a combo box

G

Guest

I am creating a subform for material order details with several fields
including separate fields for MatType and MatItem. However, each MatItem has
already been assigned a MatType. My question is how do I have the MatTypeID
that is the bound record in the MatType combo box of the form pass along the
MatTypeID to the MatItem combo box to allow only Material Items with a
matching MatTypeID? Any help would be appreciated. Thanks.
 
S

Sylvain Lafontaine

The easiest way to do this would be to set the Row Source of the MatType
ComboBox so that only the relevant type are returned:

ComboBoxMatType.RowSource = "Select ...... Where MatTypeID=" & MatTypeID

There is not need to make a requery after this assignation. You can also
use a stored procedure with parameter:

ComboBoxMatType.RowSource = "exec MySP " & MatTypeID

Finally, if the parameter @MatTypeID is already part of the InputParameters
property for the form, then you can use the name of the above procedure
directly as a static property and call the Requery method of
ComboBoxMatType.

Finally, there is a newsgroup about ADP: m.p.access.adp.sqlserver .
 

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