Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / December 2007

Tip: Looking for answers? Try searching our database.

Date Field Update Based on Start Date

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
gumby - 13 Dec 2007 13:32 GMT
I would like to update A field with a End Date that is 45 days from
the Start Date.

I have tried is in the defualt value of my enddatefield

DateAdd("d", 45, DatesOfCOPStart)

However nothing happens.

I even tried a put this on a onclick event and a got/lost foucs
event.

Private Sub Command108_Click()
Dim UpdateDate As String

If IsNull([DatesOfCOPStart]) Then
Exit Sub
Else
UpdateDate = DateAdd("d", 45, DatesOfCOPStart)
Me.DatesOfCOPEnd = UpdateDate
End If
End Sub

It updates but only after I leave the record and come back. How can I
get the field to update on the spot?

David
ruralguy - 13 Dec 2007 15:48 GMT
You should really *not* have a field in your table that is calculated from
another field in your table.  Just calculate the value any time you need it.

>I would like to update A field with a End Date that is 45 days from
>the Start Date.
[quoted text clipped - 23 lines]
>
>David

Signature

RuralGuy (RG for short) aka Allan Bunch MS Access MVP - acXP WinXP Pro
Please post back to this forum so all may benefit.

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.