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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using an Option Group to adjust query criteria.

Status
Not open for further replies.

Secretgeek

Technical User
Jan 3, 2008
80
GB
Good afternoon.

I have an Option group consisting of 4 options Q1, Q2, etc and a command button that I want to run a query whose criteria is based on the selection in the Option group.

The criteria should basically be:

If Q1 selected then choose records where [DateClosed] => 01/04/08 and <= 30/06/08

If Q2 selected then choose records where [DateClosed] => 01/07/08 and <= 30/09/08

etc, etc.

I'm normally alright with Access but I'm not familiar with this way of using queries and I've looked around the Forums but not come up with anything that seems to do the trick.

Any help or pointers would be much appreciated.

Regards
 
I would create a column in the query to calculate the query like:
Qtr:Format(DateAdd("m",-3,[DateClosed]),"Q")

Option buttons within groups have numeric values so you should be able to set the criteria under this new column to:
Forms!frmYourForm!optGrpYourGroup

This assumes the Qtr1 option has a value of 1.

Duane MS Access MVP
Now help me support United Cerebral Palsy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top