Search for date in table

C

chris seiter

I am using Access to keep track of my daily, weekly, monthly, and quarterly
IT maintenance tasks. Each table has a date column. When I open the form,
the default value for date is Date(), which populates the table row when I
begin entering information. Throughout the day when I open and close the
form, it opens today's records allowing me to finish, but when I open it the
next day, it used the last record's date and listed that date's figures. How
can I get it to search the table for today's date, and if it is there,
display the records for completion, but if it isn't, make a new record so I
don't have to constantly type in today's date?
 
S

scubadiver

Maybe you can base the form on a query and filter it for today's date - 1 ??

=date() - 1

just an idea.
 
C

chris seiter

I started over with making a query that looked up today's date in the
tblDailyMaintenance. I was able to get it right, but the form would not take
the values. I left it after trying several expressions in the criteria and
the onLoad. Fresh eyes ( and Mountain Dew) got me looking at the onLoad for
the form again. Right now there is a onLoad macro that runs called
goto_date. The first step is gotoRecord-new, and the second step is
findRecord-=Date(). This brought up today's date in the date field. I
entered a few values in it, and closed the form. On reopening the values
were populated correctly. I'll see if it works over the next few days, as
I've learned my lesson on changing time on my machine.
 
C

chris seiter

That worked, but I get an error message if the table is empty. Oh, well.
Thanks for putting me on the path to trying a formula.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top