query help!

jenny_gurl

jenny_gurl
Local time
Tomorrow, 01:04
Joined
Oct 10, 2005
Messages
23
hello,

I am having some trouble with a particular query. I basically have a table that contains all the expenses accrued over the year. I have a form which displays these expenses. I need to have options in this form whereby a user is given option buttons, where he can click on a button to view the expense for the month. For eg. If he clicks on a button named "Jan", he gets the expenses for January only.

I had based my form on a query which has a parameter value (i.e. the current month). It gets its value from the option group (the default being the current month). But i also have an "ALL" option whereby if the user clicks this button he sees all the expenses that have accrued irrespective of the months. put simply no parameter value is used, but all the months' expenses from Jan to Oct are displayed.

Can someone please tell me how i can do this?
 
It would be easier to have 2 unbound controls on your form called txtStart and txtEnd. When you open the form, have txtStart default to the earliest date in your table and txtEnd to today's date. So it will show all records. Set the criteria in your query to:

BETWEEN Forms!formname!txtStart AND Forms!formname!txtEnd (use your actual formname).

Add a button to requery the form after the dates are entered.
 

Users who are viewing this thread

Back
Top Bottom