A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

automatic entry of previous record



 
 
Thread Tools Display Modes
  #1  
Old November 4th, 2008, 09:40 PM posted to microsoft.public.access.tablesdbdesign
Bill
external usenet poster
 
Posts: 1,009
Default automatic entry of previous record

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 ??
  #2  
Old November 4th, 2008, 10:14 PM posted to microsoft.public.access.tablesdbdesign
tkelley via AccessMonster.com
external usenet poster
 
Posts: 150
Default automatic entry of previous record

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 ...

Bill wrote:
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 ??


--
Message posted via http://www.accessmonster.com

  #3  
Old November 4th, 2008, 10:29 PM posted to microsoft.public.access.tablesdbdesign
Duane Hookom
external usenet poster
 
Posts: 7,177
Default automatic entry of previous record

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

--
Duane Hookom
Microsoft Access MVP


"Bill" wrote:

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 ??

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 10:06 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.