Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Filter for today's date in data entry form

Status
Not open for further replies.

dawnd3

Instructor
Joined
Jul 1, 2001
Messages
1,153
Location
US
I thought this would be easy, but it isn't working. I created a datasheet style form where there could be many entries for a single day. I only want it to show the user the current day. So I put =Date() as the criteria for the date field in the underlying query. Did I put the wrong expression? Did I put it in the wrong place?

Thanks,

Dawn

 
It is hard to tell. What is not working? Can you post the SQL? Is the date field set up as a date/time field?
 
What is not working is that I put =Date() in the criteria field of the date column and it is still showing all records instead of just showing me the records for today's date. I don't have the SQL because I didn't keep the query because it wasn't working and I was trying different things. I also tried to put [DateField]=Date() in the filter property of the form. I also tried Now() and CurDate() but nothing is working.

Dawn

 
Is your date field truly a date value or is it a string or numeric field formatted to look like a date?
 
Open the form's Record Source in design view and set the SQL to something like:
Code:
Select *
FROM tblYourTable
WHERE [YourDateFiel] = Date();
View this in datasheet view to make sure it works as expected. Then close the query design and accept the changes to the Record Source property. Save the form.

Duane
Hook'D on Access
MS Access MVP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top