|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
working with a MS Access calendar
Hello, everyone
![]() I'm by no means an expert with Access, and need help with what's probably a small problem.... OK, I've got a calendar on a form. When the user clicks the Go button (next to the calendar), the selected calendar date is passed into a hidden text field in the form 01/01/2003. This field's value is used to look up matching records in my tables (i.e. find records that SailDate matches the value of the text box, and then open a second small form that shows SailDate, ShipName, DepartedFrom, WentTo... you get the picture. pretty simple. i think). Note: i've also made it so that these fields only show up on the second form that's opened IF there are matching data... if a search for a date returns no data, it sets all fields to field.visible=false and warninglabel.visible = true... warninglabel being a small bit of text that says "No data found". this all works fine, after many hours of pulling out hair, consulting various texts and websites, etc... OK... now my problem. I would like it if I could add another feature to users... basically, make it so that a user can search not just for records with the date they specify, but so that a user can specify a date (always a monday) and records for that WEEK show up. like a " you searched for records with week starting 01/01/2003" kinda thing. So that if a user types in 01/12/2003 (this month, starting on a monday)... the records that match 01/12/2003, 02/12/2003... until 07/12/2003 will show up. If a user types in/selects a date from the calendar that is NOT a monday, a msg box appears telling them so and no further action is taken ![]() So there are two sections to this: firstly, making sure the selected date is a Monday, secondly making it so that the selected date AND the next six dates are matched to the records. Unfortunatly, I don't know how to do either of these... I'm thinking that for the second problem maybe I could get the user to type in 01/01/2003 and somehow just count on six more days, assign it like textboxday1 = 01/01/2003 textboxday2 = 02/01/2003 textboxday3 = 03/01/2003 textboxday4 = 04/01/2003 textboxday5 = 05/01/2003 textboxday6 = 06/01/2003 textboxday7 = 07/01/2003 .. you know... just have seven hidden text boxes and match my searching terms from all seven.... but it's very messy and i don't really know what i'm doing Thanks for any help with this ![]() |
|
#2
|
|||
|
|||
|
Look at the DateAdd Function
dateOneMonthAway=DateAdd("m", 1, [SelectedDate]) I think that this is correct, but you are after the dateadd function S- |
![]() |
| Viewing: ASP Free Forums > Database > Microsoft Access Help > working with a MS Access calendar |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|