35 pts.
 Microsoft Access Date
Microsoft Access 2003 I have a Today button that uses the command.. Private Sub cmdtoday_Click() 'Sets the Date From and Date To text boxes 'to Today's Date Me!OSJPQFrom = Date Me!OSJPQTo = Date End Sub To put Today's date into my From and To Date fields. The problem is I have these From and To fields on the same forum as the records. When you press the Today button, it pulls the date from that current record. How do I get it to pull the actual date?

Software/Hardware used:
ASKED: April 8, 2009  6:29 PM
UPDATED: January 2, 2012  11:00 PM

Answer Wiki:
Let me update for clarification. I am following the example at <a href="http://www.databasedev.co.uk/report_date_parameters.html">http://www.databasedev.co.uk/report_date_parameters.html</a> I have my user date entry fields on the same page as my records. I have been able to fix my Today button by switching 'Date' to 'Now' The question is, How do I change the others (Week and Month) to reflect a week based off 'Now' s Date. Private Sub cmdweek_Click() 'Sets the Date From and Date To text boxes 'to show complete working week (Mon - Fri) Dim today today = Weekday(Date) Me!txtdatefrom = DateAdd("d", (today * -1) + 2, Date) Me!txtDateTo = DateAdd("d", 6 - today, Date) End Sub Private Sub cmdmonth_Click() 'Sets the Date From and Date To text boxes 'to show complete month (from start to end of current month) Me!txtdatefrom = CDate("01/" & Month(Date) & "/" & Year(Date)) Me!txtDateTo = DateAdd("d", -1, DateAdd("m", 1, Me!txtdatefrom)) End Sub Private Sub cmdyear_Click() 'Sets the Date From and Date To text boxes 'to show complete current year Me!txtdatefrom = CDate("01/01/" & Year(Date)) Me!txtDateTo = DateAdd("d", -1, DateAdd("yyyy", 1, Me!txtdatefrom)) End Sub
Last Wiki Answer Submitted:  April 8, 2009  6:57 pm  by  Vadle   35 pts.
All Answer Wiki Contributors:  Vadle   35 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

How do I convert a date in an access query ? example 112508 to 08/25/11

 25 pts.