Defaults in queries, forms

Marky

Registered User.
Local time
Tomorrow, 05:08
Joined
Mar 26, 2012
Messages
14
How can I set Month or Year default as per the system date. ie Only select records by Month (October) or Year (2013) as per system date?
 
Check out the Month(), Year(), and Date() functions provided by VBA.

To set the Default Value of a control, check out the control's DefaultValue property.

To return records by month and year for a particular date, you can write a WHERE clause like . . .
Code:
WHERE Month([YourDateField]) = Month(Date())
   AND Year([YourDateField]) = Year(Date())

hth
 
Thanks a lot, I'll try that. It should work. Just to clarify, a form/report etc should only have this month's records or this year's records without using the filter options. Cheers
 
Just to clarify, a form/report etc should only have this month's records or this year's records without using the filter options.
Ahh, what is clarified here? :confused: You asked cryptically about dates, defaults, and selecting records. Nothing about forms/reports.
 

Users who are viewing this thread

Back
Top Bottom