adp form combo box

  • Thread starter Thread starter slimlah
  • Start date Start date
S

slimlah

Hi

I'm really new to adp,

I created a form with a combo box (1) to a with a list.

Once I selected a value from combox 1, I want to use that value for my
filter for my combox 2

Can I can I do that from the row source?

I can use both view or sp.

Can anyone help?

Thanks
 
This question (and others) has been answered many times in the past. As you
are new to ADP, taking a look at past messages should be valuable to you.
On Google:

http://groups.google.ca/group/microsoft.public.access.adp.sqlserver

Now, for your question, the best to deal with ADP is usually to use SP. One
way to update the second combobox is to change its record source in the
AfterUpdate event of the first one:

Me!ComboNo2.RowSource = "exec ComboNo2_SP " & Me.ComboNo1

(Of course, if the value is a string then you must enclose it between single
quotes and use the Replace function if necessary i you have single quotes in
the string value itself.)

The second possibility is to set the RowSource property to the name of the
SP (and it's better if you prefix it with dbo.) with parameters, put the
paramaters in the InputParameters property of the form and requery this
combobox in the AfterUpdate event of the first combobox. However, this
method also requires that all parameters for the SP are also parameters of
the main SP for the form itself.
 
Back
Top