Query by form, Query explodes after being closed for the first time, any help appre

New to Access

New member
Local time
Today, 15:07
Joined
Apr 21, 2011
Messages
1
Hey guys,

As the name suggests, I am new to Access.

I am sorry to ask such a basic question from everybody. To reassure people, I found this thread - 103312 - the site won't let me post the link until I have posted 10 times) from 06 but it did not help, just hinted at the same problem.

I work for an organisation and part of my job is to track a legislature. I have built a simple database and wanted to use the query by form tecnhique. I have made a form to allow users to track contact between my organisation's staff and members of the legislature. I want people to be able to select different combinations of options on the form (incluidng leaving some left blank) to allow searches along the lines of 'Show me all contact between staff member X and legislature members'; 'what members from this party have we spoken to on subject Y?'; what members from this state have we spoken to on this issues in the period 08-09'? etc.

The criteria in the query so far are

[Forms]![Search Form]![Group] Or [Forms]![Search Form]![Group] Is Null


[Forms]![Search Form]![State] Or [Forms]![Search Form]![State] Is Null


[Forms]![Search Form]![Staff] Or [Forms]![Search Form]![Staff] Is Null

Between [Forms]![Search Form]![Start Date] And [Forms]![Search Form]![End Date] Or [Forms]![Search Form]![Start Date] Is Null


[Forms]![Search Form]![Subject of contact] Or [Forms]![Search Form]![Subject of contact] Is Null


THIS WORKS. However, as soon as close the query it goes haywire, Access splits the criteria and puts them all oever the place, on new columns, rows etc. It maintains funtionality and is impossable to update. Also, it means that my suvecessor won't ahave a clue what is going on.

Can some onetell me how I can keep the same functionlity (search by options selected on a form, including some left blank) without Access putting the criteria of the Query everywhere?

Many thanks.

 
The criteria in the query so far are

[Forms]![Search Form]![Group] Or [Forms]![Search Form]![Group] Is Null

...
Are the criteria connected somehow using a keyword like OR or AND?

The criteria above is true when
[Forms]![Search Form]![Group] = true or [Forms]![Search Form]![Group] is null


if all the criteria lines is one WHERE clause then you might want to consider using braces () to group parts of the criteria together.


HTH:D
 

Users who are viewing this thread

Back
Top Bottom