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

Testing for a specfic format value

P: 2
I have a series of Access Queries that run depending on the day of the week. The user chooses a date from a pull down calendar (ie 10/1/2012). I want to find out what day of the week 10/1/2012 is (Monday in this case.) and then test for that value to execute the proper query... I am not very conversant in VB, so please be detailed in your explaination.

Thanks for your time and assistance.
Oct 29 '12 #1
Share this Question
Share on Google+
3 Replies

Expert Mod 10K+
P: 12,382
The Weekday() function will tell you which day of the week it is, where 1 is sunday, 2 is monday, and so on. You can use that with a case statement to run the query of your choice.

If you do not understand how to implement this, you should look into a VBA class/tutorial before trying to take on a project of this scope.

If you have trouble implementing it, post the code you tried and we can help you spot the problems.
Oct 29 '12 #2

Expert Mod 5K+
P: 9,731
What technology are you using... VB.NET or VBA?

In .NET you can use the DatePicker control to allow the user to choose a date. It has a property called SelectedDate which returns you a DateTime type.

The DateTime type has a DayOfWeek property that will tell you which day of the week the user selected.

Oct 31 '12 #3

P: 2
Thank you both for your assistance. The project I was doing this for has been scrapped so it was all for naught!
Jan 31 '13 #4

Post your reply

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