Pick Year and Pick Quarter

S

Sweeds

Is it possible to create a query to run behind the scenes and do this?

I have a form and I would like the user to pick the year, and then
they have a drop down that contains the quarters (Q1, Q2, Q3, or Q4).
Based on the year they pick and the quarter, it puts the correct dates
in the box.

Example, I choose 2008 and Q2 - it auto populates April 1, 2008 into
one box and June 30, 2008 into the other.

I will post on forms group as well, but I figured this is a query
question.
 
J

John W. Vinson

Is it possible to create a query to run behind the scenes and do this?

I have a form and I would like the user to pick the year, and then
they have a drop down that contains the quarters (Q1, Q2, Q3, or Q4).
Based on the year they pick and the quarter, it puts the correct dates
in the box.

Example, I choose 2008 and Q2 - it auto populates April 1, 2008 into
one box and June 30, 2008 into the other.

I will post on forms group as well, but I figured this is a query
question.

I'd suggest basing the quarters combo box on a query of a little four row
table:

Q1 1
Q2 4
Q3 7
Q4 10

Then as a criterion, use
= DateSerial(Forms!yourform!Forms!yourform!cboYear, Forms!yourform!cboQuarter, 1) AND < DateSerial(Forms!yourform!cboYear, Forms!yourform!cboQuarter + 3, 1)

or use the same expressions as the controlsources of your textboxes.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top