Share via

MS Access Auto Date Question

Anonymous
2019-10-12T08:06:47+00:00

I'm using Access to keep track of hours worked, somewhat like a time sheet. So I want to have a "Work Date" column which auto-fills with the next date on each line. In other words, every record will have a new date which is just one day after the date of the previous record.

This would be like the date equivalent of auto-numbering. I have entered the dates below manually, but the idea is that the dates would be auto-filled with each new record.

Please let me know if there is any way to do this.

Thanks!

Microsoft 365 and Office | Access | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

ScottGem 68,830 Reputation points Volunteer Moderator
2019-10-12T12:47:15+00:00

You can't do this in the table. That's why the DMax is not working. You should never work directly in tables. You should create a form to interface with your table as I instructed. Then set the Default value of the WorkDate control as indicated.

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments

Answer accepted by question author

Anonymous
2019-10-12T11:14:37+00:00

As I wrote, you can't do it in the table. Use the textbox in your form that edits the data.

And now that you have modified the table and field names, the expression will be:

=DateAdd("d",1,DMax("[WorkDate]","[DailyLog]"))

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments

7 additional answers

Sort by: Most helpful
  1. Anonymous
    2019-10-12T10:42:26+00:00

    DMax can't possible fail in this context, so something else must be going on.

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2019-10-12T10:31:49+00:00

    GustavBrock, thanks a lot for the reply!

    I can't get the dmax() function to work. Is there any other way to pull the max date from the [Work Date] field?

    Thank you.

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2019-10-12T09:57:44+00:00

    You can't do that in the table.

    But in the form, you use to edit the data, specify the Default Value for the textbox bound to Work Date to:

    =DateAdd("d",1,DMax("[Work Date]","[Daily Log]"))

    Was this answer helpful?

    0 comments No comments