By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,209 Members | 1,100 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,209 IT Pros & Developers. It's quick & easy.

Using Combo Box To Select query criteria

P: 37
First of all I want to thank all of you that have helped me in the past this is an awesome fourm.

My problem today is I have a database that builds charts that are viewed by a large group every friday morning. I am building six different charts that all have query criteria of between two dates right now I am going and updating the charts manually every week. The dates these charts work on is always friday to thursday every week. Is there anyway to make the querys select criteria by days of the week. Or I could go and manually enter all the date ranges I would like to have an option into a combo box for the viewers to select. I have searched and can't find anything on using a combo box to input query criteria or making access reconize to change the criteria one week later on a certain day of the week. I hope i have been clear enough hard to explain and thank you all in advance.

Thanks!
Oct 12 '07 #1
Share this Question
Share on Google+
2 Replies


NeoPa
Expert Mod 15k+
P: 31,494
This is perhaps a little vague, but if I understand you correctly you want the date ranges for particular queries to be selectable on a form, rather than hard-coded into the queriy(ies) itself?
If so, you can build a form with a TextBox which would be set up in code (OnOpen) to default to the best-guess value of the closing date but allow the operator to change it if they need to.
Your query would then be designed to access this TextBox on the form to determine its date range. To make it easier, you could have another TextBox on the form which is updated in the AfterUpdate event of the first TextBox always to show a date six days before the other one (thereby always having matching Start & Finish dates).
Does that help?
Oct 12 '07 #2

nico5038
Expert 2.5K+
P: 3,072
Can you start by posting one of the queries you use ?

Looks to me you just need all dates from a complete week starting on Friday and finishing on Thursday.
This can be automated and even "calculated" for all data you have in your table. By using the data in your table you can offer the user a combobox showing all startdates that are available. Thus only existing dates can be selected and you don't have to worry about "impossible" dates.

When the reports are always the same (you have no updates on closed weeks), then you could store just the chart of a week in a file holding the year and weeknumber.

Nic;o)
Oct 13 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.