automatic entry of previous record

B

Bill

My data base is a record of bank deposits by date. I update the table using a
form and I would like to automatically enter the next date by adding one day
to the previous record upon new record creation. Is ther an easy way to do
this ??
 
T

tkelley via AccessMonster.com

Not sure what the definition of easy is, but try this:

Declare a variable that is public to your form:
Public LastDate as Date

Then in the BeforeUpdate event set that variable to the value of the date
field.

Then in the OnCurrent event:

If IsNull(LastDate) or LastDate="" Then
Exit Sub
Else
YourDateField.value = LastDate
EndIf

Let me know if it works ...
 
D

Duane Hookom

How many entries do you make in a day? You might be able to set the Default
Value property of the text box to something like:
=DMax("[Date Field]","tblNoNameProvided") + 1
 

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