Parameter Query

dpw

Registered User.
Local time
Today, 21:39
Joined
Nov 13, 2000
Messages
21
I have a parameter query based on an unbound field on a form. If I open the form and run the query from the form with no value in the field it doesn’t return any records. But if I open the query with that particular form closed (and enter nothing in the parameter box which appears) it returns all records. I want the latter to occur. (Used is Null in Or row).

Any ideas on why this occurs and is it possible to have 2 unbound fields on a form to do the following:

1) CountyName field is blank, StreetName has data - to display all counties and only streetnames equal to the data in the StreetName field.

2) CountyName has data , StreetName is blank- to display all streetnames and only counties equal to the data in the CountyName field.

3) Both fields empty to display all records.

I hope I've explained this correctly
 
I'm not too clear on the problem ..... do you want the form open?

Do you run the query from a button on the form?

You mention running the query when the form is closed I presume you mean from the Access DB Window and bypassing the query param as opposed to running from within the form on a button....?????

I'm sure what you are trying to do is possible but can you provide further info....????
 
I want to run the query from a button on a form with more than 1 unbound combo boxes to provide the criteria.

To get it to work for only 1 combo I used Is Null in the 'OR' row and I successfully obtained all records if the unbound combo box is empty and if data was selected, the results again proved correct. But I've based a chart (in a form) on this query and it requires you to input your parameter into the query and specify it's data type (ie by selecting Query from the toolbar and then Parameter). After I do this when I want to run the query through the form without inputting any criteria into the combo box it returns NO records.

So in order to run the query from a button on a form with more than 1 unbound combo box to provide the criteria I need to rectify this problem.
 

Users who are viewing this thread

Back
Top Bottom