Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

filter by 2 fields one as result on query & other not displayed

Status
Not open for further replies.

ahbri

Technical User
Jun 8, 2009
2
US
I need help building a form. I want to build a form to have a user be able to filter a query by 2 criterias. One field is State and is displayed in the results. I have no problem there. The other field is date (I need to do a beginning and ending date) and date will not display in the query results. The problem I have is that I can't choose the date field in the form wizard because it is not an available field since it won't be shown in my results. Any idea on how I can add the date as a criteria on my form?
 
For entering the state and the date, are you providing unbound fields on your form? A field is unbound if it's Control Source is empty.

I don't understand your problem, because you always choose to hide or show any field on a form. But perhaps you are using bound fields and that is why you must show it.

[purple]If we knew what it was we were doing, it would not be called
research [blue]database development[/blue], would it? [tab]-- Albert Einstein[/purple]​
 
Here is my query that is built.

SELECT [Sales Data 2009].Retailer_Name, [Sales Data 2009].Sale_Total, [Sales Data 2009].Quantity_Sold, [Retailer List].State_Province
FROM [Sales Data 2009] LEFT JOIN [Retailer List] ON [Sales Data 2009].Retailer_Name = [Retailer List].Retailer_Name
WHERE ((([Sales Data 2009].Sold_On) Between #2/1/2009# And #2/28/2009#))
GROUP BY [Sales Data 2009].Retailer_Name, [Sales Data 2009].Sale_Total, [Sales Data 2009].Quantity_Sold, [Retailer List].State_Province
HAVING ((([Retailer List].State_Province)="CA"))
ORDER BY [Sales Data 2009].Sale_Total DESC;


I am trying to build a form so that the user can fill in the state field and the date range. But in the results I don't want to show date range. Because the date is a where clause and not displayed then the form wizard doesn't allow it to be a field that is selected for the form. I am not good enough to not use the wizard to build a form.

To answer your other question they are bound fields.
 
This article from Microsoft may be helpful.

[purple]If we knew what it was we were doing, it would not be called
research [blue]database development[/blue], would it? [tab]-- Albert Einstein[/purple]​
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top