Using field in view criteria

jason_nevin

Registered User.
Local time
Today, 16:23
Joined
Nov 22, 2002
Messages
46
Good morning

I have a list box with a SQL server view as the data source. I want the dataset to be filtered to include only results with a particular foreign key which is stored in a field on my form.

I can do it in the behind module by programmatically specifying the row source but I'm presuming that there is a better way. In Access you would specify a field name in the criteria of a query, but how do I do it in an Access Project?

Thanks.
 
Hi there,

You need to somehow parse this filter value from the form to the view as an input parameter, but unfortunately views do not support parameters.

So you can either set the row source in a module as you mentioned or use a stored procedure with an input parameter.

For simplicity I would set the row source in a module
 

Users who are viewing this thread

Back
Top Bottom