how to pass value from a form to sql view (query)

C

cyruslove

hi guys!

i have recently started SQL server based programming,
i am creating a view (query) on my sql server and want to pass a value from a
combo box on a form.
how can i do that. i could not build criteria as we do in .mdb query design.
short information of the form:
i am using a subform which will be based on a query that has a criteria
receiving value from a combo box on the main form, so when user selects any
value from the combo box the subform will show only the matching records.
looking forward for a quick solution buddies.
 
A

AkAlan via AccessMonster.com

This is one way
in the After Update event

Me.FilterOn = False
Me.Filter = "[Some_Criteria] = '" & Me.cboSomeComboBox & "'"
Me.FilterOn = True
 

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